Fix a leak in `FutureState` when a `Notifier` is dropped un-woken 2023-04-fix-future-leak
authorMatt Corallo <git@bluematt.me>
Wed, 26 Apr 2023 05:01:13 +0000 (05:01 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 26 Apr 2023 05:43:23 +0000 (05:43 +0000)
commit7caa5840513332bab30b3f8db45c938c8e07011b
tree64f45fd4c8e48bbaf8c4f41bb5db89a52bc1de50
parent3873afcb752fa5e84868719e71d506ae8a6592ae
Fix a leak in `FutureState` when a `Notifier` is dropped un-woken

If a `Notifier` has an internal `FutureState` which gathers some
sleeper callbacks, but is never actaully woken, those callbacks
will leak due to a circular `Arc` reference when the `Notifier` is
`drop`'d.

Because `Notifier`s are rarely `drop`'d in production this isn't a
huge deal, but shows up materially in bindings tests as they spawn
many nodes over the course of a short test.

Fixes #2232
lightning/src/util/wakers.rs