Fix long-standing race in net-tokio reading after a disconnect event
authorMatt Corallo <git@bluematt.me>
Mon, 24 Feb 2020 19:17:04 +0000 (14:17 -0500)
committerMatt Corallo <git@bluematt.me>
Wed, 11 Mar 2020 16:19:39 +0000 (12:19 -0400)
commit60d37b2698e5cb3744263ecc95c68bb2dee93ea4
treed9ad5198daac3b64303db5c1a40d5e33ff400969
parent5ada94046456909c07b135dca9ceac41963afdf4
Fix long-standing race in net-tokio reading after a disconnect event

If rust-lightning tells us to disconnect a socket after we read
some bytes from the socket, but before we actually give those bytes
to rust-lightning, we may end up calling rust-lightning with a
Descriptor that isn't registered anymore.

Sadly, there really isn't a good way to solve this, and it should
be a pretty quick event, so we just busy-wait.
lightning-net-tokio/src/lib.rs