pub struct ReaderPumpGuard { /* private fields */ }Expand description
The spawned reader pump, woken and joined on every exit path.
§Invariant
MUST: once the reader pump has been spawned, it is woken and joined before
its owner returns — clean return, ?, or a panic unwinding out of the
caller.
§The defect this closes
A writer-spawn failure used to ? out with the reader already running,
leaving it parked in read behind an SO_RCVTIMEO that a PVA op_timeout
makes effectively infinite (~64,000 s by default), holding its socket and
its descriptor for the life of the IOC. The connection slot was returned
correctly, which is exactly what made the leak invisible: the connection
count looked healthy while descriptors drained away.
Owning the handle in a guard, rather than calling cleanup on the error branch, is what makes the leak unexpressible: there is no way to have spawned the reader without also holding the value that joins it. The same applies to the panic path, which no error-branch cleanup could have covered.