mirror of https://github.com/oxen-io/lokinet
Fix link layer delivery race condition (fix random ping delays)
We trigger a pump immediately, but this is racey because we add to our plaintext data in a worker thread; if the worker thread runs after the pump then it ends up leaving plaintext to be handled, but there's no wakeup until the next one. This was the cause of seeing a random +1s and bunching added to ping responses sometimes: it wasn't until the *next* ping goes through the network that the plaintext queue gets processed, at which point it flushes the old one and often the new one together. The fix here gets rid of the map of sessions needing wakeups and instead adds an atomic flag to all of them to let us figure out which ones need to be flushed.pull/1795/head
parent
aa1dc83459
commit
74215fc44c
Loading…
Reference in New Issue