tokio-rs / turmoil

Add hardship to your tests
MIT License
790 stars 50 forks source link

Fix duplicate FIN in the drop glue #142

Closed mcches closed 1 year ago

mcches commented 1 year ago

If the stream is shutdown manually it sends a FIN on the write half, however we don't check the state in the drop implementation, which led to a duplicate FIN being sent.

To fix, is_shutdown is checked before sending the FIN.

mcches commented 1 year ago

Verified 2x of these before, only one after the change.

2023-10-20T16:36:05.204647Z TRACE node{name="client"}: turmoil: Send src=192.168.0.2:49152 dst=192.168.0.1:1738 protocol=TCP FIN