Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update registry.rs #14695

Open
wants to merge 1 commit into
base: 0918-alden-fix-deadlock-2
Choose a base branch
from

Conversation

ziaptos
Copy link
Contributor

@ziaptos ziaptos commented Sep 19, 2024

Reverting the condition to check whether the bench tests failures persists.

Description

If before Entry::drop() calls Registry::maybe_remove, the weak ref under the same key1 and key2 is replaced, Entry::drop can be called recursively resulting in a deadlock. The crux is we try to see if the entry has been replaced by trying to upgrading it to a strong ref, and it possible that the upgrade is successful and the result becomes a only ref to the new entry.

This tries to fix it by determining the same thing by seeing if Weak::strong_count() is 0 instead of upgrading the weak ref.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Other (specify)

How Has This Been Tested?

Key Areas to Review

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Reverting the condition to check whether the bench tests failures persists.
Copy link

trunk-io bot commented Sep 19, 2024

⏱️ 16m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-move-tests 10m 🟩
check-dynamic-deps 2m 🟩
rust-cargo-deny 2m 🟩
general-lints 2m 🟩
semgrep/ci 17s 🟩
file_change_determinator 13s 🟩
file_change_determinator 11s 🟩
permission-check 3s 🟩
permission-check 2s 🟩
permission-check 2s 🟩
permission-check 2s 🟩

🚨 1 job on the last run was significantly faster/slower than expected

Job Duration vs 7d avg Delta
check-dynamic-deps 2m 1m +106%

settingsfeedbackdocs ⋅ learn more about trunk.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant