Problem
When a client request future is dropped/cancelled mid-send (e.g., partial body),
hyper-util sends FIN via poll_shutdown(). This tells the server "I'm done sending"
rather than "abort/discard."
Why RST would be better
- FIN + truncated body can cause server to wait for remaining data (timeout)
- Server might attempt to process incomplete request
- RST semantics ("abort") match the intent of cancellation
Current behavior
- Request future dropped
- Connection detects cancellation via
poll_canceled()
poll_shutdown() called → FIN sent
- Server receives incomplete request + graceful close
Suggested behavior
Option to send RST instead of FIN when a request is cancelled mid-flight.
Could be a pool config option like rst_on_cancel(true).
Workaround
Currently requires setting SO_LINGER=0 on the socket in a custom connector somehow just before connection is dropped.
Problem
When a client request future is dropped/cancelled mid-send (e.g., partial body),
hyper-util sends FIN via
poll_shutdown(). This tells the server "I'm done sending"rather than "abort/discard."
Why RST would be better
Current behavior
poll_canceled()poll_shutdown()called → FIN sentSuggested behavior
Option to send RST instead of FIN when a request is cancelled mid-flight.
Could be a pool config option like
rst_on_cancel(true).Workaround
Currently requires setting
SO_LINGER=0on the socket in a custom connector somehow just before connection is dropped.