| Previous | Next |
| EALREADY | ENOTRECOVERABLE |
ECONNRESET
ECONNRESET means the socket stack was told that the peer relationship has been forcibly terminated. For TCP, that commonly corresponds to a reset segment. The TCP specification allows resets both from an endpoint and from protocol processing when a segment does not belong to an active connection, so the error alone does not establish whether an application crash, a timeout policy, or a middlebox caused it.
A reset can be observed on a later recv() or send() rather than at the moment the other side closed. Treat the socket as unusable: preserve any application-level context needed for logging, close it, and create a new connection when retrying is safe. Do not assume that bytes handed to the kernel before the reset were processed by the peer.
How to investigate
- Correlate the timestamp with peer, load-balancer, proxy, and firewall logs.
- Record whether the connection was reused and what request or protocol frame was in flight.
- Use packet capture or transport telemetry when the distinction between a peer reset and an intervening device matters.
- Retry only idempotent work unless the protocol supplies an acknowledgement that proves the prior operation was not applied.
RFC 9293: TCP reset processing · Linux send(2) · UNIX-domain socket behavior
Looking for a different code? Search another status or error code.
