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

[R4R]fix potential deadlock of pub/sub module #59

Merged
merged 1 commit into from Jan 11, 2021
Merged

Conversation

unclezoro
Copy link
Collaborator

@unclezoro unclezoro commented Dec 30, 2020

Description

Fix the potential deadlock of pub/sub module.

More detail in: #58

Rationale

The deadlock dependency is:

Routine A:NewPendingTransactionFilter want to lock filtersMu to consume hashes;
Routine B: eventLoop is waiting Routine A to consume hashes so that it can push new hash to channel.
Routine C: Unsubscribe is holding lock filtersMu, but it is waiting for Routine B to consume uninstall channel.

Example

add an example CLI or API response...

Changes

There is no need to fetch lock on NewPendingTransactionFilter routine, so just loose the logic.

And fix the potential risk that Unsubscribe routine does not drain all the hash, header and log.

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • manual transaction test passed

Already reviewed by

...

Related issues

@unclezoro unclezoro merged commit 3f3f8d0 into master Jan 11, 2021
@unclezoro unclezoro deleted the issue_58 branch January 18, 2021 12:26
@unclezoro unclezoro mentioned this pull request Jan 19, 2021
3 tasks
@j75689 j75689 mentioned this pull request Aug 31, 2021
3 tasks
Pythonberg1997 pushed a commit to Pythonberg1997/bsc that referenced this pull request Mar 29, 2023
…-layer-liveness

imporve liveness of block proposal layer
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.

None yet

3 participants