Skip to content

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

Merged
unclezoro merged 1 commit intomasterfrom
issue_58
Jan 11, 2021
Merged

[R4R]fix potential deadlock of pub/sub module#59
unclezoro merged 1 commit intomasterfrom
issue_58

Conversation

@unclezoro
Copy link
Copy Markdown
Contributor

@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
galaio pushed a commit to galaio/bsc that referenced this pull request Jul 31, 2024
galaio pushed a commit to galaio/bsc that referenced this pull request Jul 31, 2024
Co-authored-by: andyzhang2023 <andyzhang2023@gmail.com>
Co-authored-by: bnoieh <135800952+bnoieh@users.noreply.github.com>
j75689 pushed a commit to j75689/bsc that referenced this pull request Apr 2, 2025
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.

3 participants