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>
Sun, 1 Mar 2020 04:26:15 +0000 (23:26 -0500)
commit21d897e579edfb724e0ccfeaf4e20878cd7b8244
tree3222d8d8f1c48164f9e587d5fed2a69cd93c5e7c
parent6a84ef03ebfbecac39a6ff454d248dd9c8432246
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