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

fix(store): greedy heightSub cancellation #168

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

Wondertan
Copy link
Member

So, I was playing around with similar code and taking heightSub as an inspiration. While writing that code, I realized that heightSub has a nasty bug. Basically, a subscription cancellation removes the other active subs for the same height, leaving them blocked forever. We could observe some abnormal blockings in the past, which may explain it.

I provided a test scenario that proves the issue existed and the fix works.

So I was playing around with the similar code and taking heightSub as an inspiration. While writing that code I realized that heightSub has a nasty bug.
Basically a subscription cancellation removes the others active subs for the same height leaving them blocked forever.
We could observe some abnormal blockings in the past and this may explain it.
@Wondertan Wondertan self-assigned this Apr 1, 2024
@Wondertan Wondertan changed the title fix(p2p): set connect timeout fix(store): greedy heightSub cancellation Apr 1, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.02%. Comparing base (3b63466) to head (05bf4df).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #168      +/-   ##
==========================================
+ Coverage   62.88%   63.02%   +0.13%     
==========================================
  Files          39       39              
  Lines        3573     3581       +8     
==========================================
+ Hits         2247     2257      +10     
+ Misses       1154     1152       -2     
  Partials      172      172              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@vgonkivs vgonkivs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic finding 🔥

Copy link
Member

@renaynay renaynay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow nice catch

@Wondertan Wondertan merged commit a465a27 into main Apr 2, 2024
4 checks passed
@Wondertan Wondertan deleted the store/fix-heightsub-cancellation branch April 2, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants