Make waking after a future completes propagates to the next future 2023-03-debug-futures
authorMatt Corallo <git@bluematt.me>
Thu, 2 Mar 2023 07:50:16 +0000 (07:50 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 2 Mar 2023 07:50:16 +0000 (07:50 +0000)
commitcd03cb647745afc4f886d94cec70528dc3cac6f1
treeabb53d0f066e361fd2395eab737cae7d703770e7
parent96c8507fbf55b3ecc2009d2da5966ae9e391b310
Make waking after a future completes propagates to 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.
lightning/src/util/wakers.rs