quinn: Hang during Connecting.await for incoming connections
Running my previous test case further surfaces two more issues:
ConnectionError::Reseton line 82. This seems possibly a bug but like theApplicationClosederror in my previous example it doesn’t block progress so is ignored;- Hanging in
Connecting.awaiton line 103. strace shows packets are being sent and received, but this.awaitnever returns.
I used the following to simulate an unreliable network on Linux:
tc qdisc add dev lo root netem delay 5ms 10ms 25% distribution normal loss 5% duplicate 5% reorder 40% 50%
Note this seems to be buggy on kernels < 4.18.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (6 by maintainers)
I’m pretty sure I see what’s happening with the hang:
Connectingfuture to the application. This pattern can be identified easily by looking for traces whereinitial_dcid=fooappears once andicid=fooappears twice.At this point the server cannot take any further action on the connection initiated by the duplicated packet. Because you’ve disabled the idle timeout, the connection is permanently hung. This is working as intended.
In summary, the idle timeout must not be disabled in environments where a client might disappear unexpectedly or packets may be duplicated and no other mechanism exists to clean up zombie connections. I’ll prepare a PR to update the documentation to clarify this.
I suspect this might be due to the somewhat dubious handshake state machine in draft 24. I’m going to try to get us updated to draft 27 and then revisit.