Await `Future::poll` `Complete`d before unsetting notify-required 2022-11-fix-broken-futures-----again
authorMatt Corallo <git@bluematt.me>
Tue, 15 Nov 2022 00:29:10 +0000 (00:29 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 16 Nov 2022 00:21:43 +0000 (00:21 +0000)
commit0a1e48f9c7ebf752457b0bcd904e0ae1efb005b8
treeb2ed0d86e85a468b968a84b2fbe8ba3757c81d94
parent5f053e43af4971d614574bb00c41a4e75fe8dbfd
Await `Future::poll` `Complete`d before unsetting notify-required

When we mark a future as complete, if the user is using the
`std::future::Future` impl to get notified, we shouldn't just
assume we have completed the `Future` when we call the `Waker`. A
`Future` may have been `drop`'d at that point (or may not be
`poll`'d again) even though we wake the `Waker`.

Because we now have a `callbacks_made` flag, we can fix this rather
trivially, simply not setting the flag until the `Future` is
`poll`'d `Complete`.
lightning/src/util/wakers.rs