Skip to content

Conversation

@TheBlueMatt
Copy link
Collaborator

After a Notifier has been notify'd, attempts to get_future should return a Future which is pre-completed, however this was not the case.

This commit simply fixes the behavior, adding a test to demonstrate the issue.

After a `Notifier` has been `notify`'d, attempts to `get_future`
should return a `Future` which is pre-completed, however this was
not the case.

This commit simply fixes the behavior, adding a test to demonstrate
the issue.
@TheBlueMatt TheBlueMatt added this to the 0.0.112 milestone Oct 6, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2022

Codecov Report

Base: 90.73% // Head: 90.72% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (cf3471f) compared to base (7544030).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1758      +/-   ##
==========================================
- Coverage   90.73%   90.72%   -0.01%     
==========================================
  Files          87       87              
  Lines       46713    46721       +8     
  Branches    46713    46721       +8     
==========================================
+ Hits        42383    42387       +4     
- Misses       4330     4334       +4     
Impacted Files Coverage Δ
lightning/src/util/wakers.rs 91.56% <100.00%> (+4.85%) ⬆️
lightning/src/ln/functional_tests.rs 96.90% <0.00%> (-0.15%) ⬇️
lightning/src/ln/channelmanager.rs 85.14% <0.00%> (-0.03%) ⬇️

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.

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

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

LGTM.

One general question: if the Notifier is "[u]sed to signal to one of many waiters", couldn't we also just wake one waiter, i.e., use condvar.notify_one() rather than condvar.notify_all()?

@TheBlueMatt
Copy link
Collaborator Author

Yea, probably. The public-facing docs explicitly don't provide any guarantees on which, or even how many, listeners are woken, so it doesn't really matter.

@TheBlueMatt TheBlueMatt merged commit 5c8e9ad into lightningdevkit:main Oct 7, 2022
@TheBlueMatt
Copy link
Collaborator Author

Will leave any change in the notify for a follow-up, not that its all that critical.

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.

4 participants