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

Make waking after a future completes propagates to the next future #2064

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

TheBlueMatt
Copy link
Collaborator

In our wakers, if we first notify a future, which is then polled complete, and then notify the same waker again before a new future is fetched, that new future will be marked as non-complete initially and wait for a third notify.

The fix is luckily rather trivial, when we notify a future, if it is completed immediately, simply wipe the future state so that we look at the pending-notify flag when we generate the next future.

In our `wakers`, if we first `notify` a future, which is then
`poll`ed complete, and then `notify` the same waker again before a
new future is fetched, that new future will be marked as
non-complete initially and wait for a third `notify`.

The fix is luckily rather trivial, when we `notify` a future, if it
is completed immediately, simply wipe the future state so that we
look at the pending-notify flag when we generate the next future.
@TheBlueMatt TheBlueMatt added this to the 0.0.114 milestone Mar 2, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +1.40 🎉

Comparison is base (96c8507) 87.34% compared to head (cd03cb6) 88.75%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2064      +/-   ##
==========================================
+ Coverage   87.34%   88.75%   +1.40%     
==========================================
  Files         101      101              
  Lines       44296    54434   +10138     
  Branches    44296    54434   +10138     
==========================================
+ Hits        38691    48312    +9621     
- Misses       5605     6122     +517     
Impacted Files Coverage Δ
lightning/src/util/wakers.rs 98.70% <100.00%> (+0.28%) ⬆️
lightning/src/util/time.rs 38.29% <0.00%> (-1.71%) ⬇️
lightning/src/sync/nostd_sync.rs 42.10% <0.00%> (-0.40%) ⬇️
lightning/src/chain/channelmonitor.rs 89.24% <0.00%> (-0.34%) ⬇️
lightning/src/ln/peer_handler.rs 58.60% <0.00%> (-0.18%) ⬇️
lightning/src/sync/mod.rs 50.00% <0.00%> (ø)
lightning/src/sync/test_lockorder_checks.rs 100.00% <0.00%> (ø)
lightning/src/ln/functional_test_utils.rs 89.08% <0.00%> (+0.64%) ⬆️
lightning/src/ln/onion_route_tests.rs 96.10% <0.00%> (+0.65%) ⬆️
lightning-rapid-gossip-sync/src/processing.rs 93.80% <0.00%> (+0.66%) ⬆️
... and 27 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@wpaulino wpaulino self-requested a review March 2, 2023 18:01
@TheBlueMatt
Copy link
Collaborator Author

Kicked CI - looks like it was more flakyness on the lightning-transaction-sync tests.

@wpaulino wpaulino merged commit 6ddf69c into lightningdevkit:main Mar 2, 2023
MaxFangX added a commit to lexe-app/rust-lightning that referenced this pull request Mar 2, 2023
@wpaulino wpaulino mentioned this pull request Mar 3, 2023
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

4 participants