Retried requests can replay late from a dead connection's socket buffer
In a client/server protocol where the client times out, reconnects and retries, an old copy of a request can still be in the server's kernel socket buffer or user-space work queue on the abandoned connection. The server may run it after the retry was acked and after a newer write, undoing that write. Skipping jobs from closed connections only covers the queue, and only once the server has noticed the close. Robust fix: the client sends a random client id as the first frame of every connection; the server tracks client id -> current connection and drops anything arriving on, or queued from, a replaced connection. Check at read time, at job pop, on requeue, and right before mutating. To test it, use a proxy that holds a request on the old connection and delivers it only after the retry on a new connection was acked.