After a server closes the connection, the connection is marked as closed, but the connection is kept in the endpoint[key] cache.
Later requests to send data over that connection fail silently (Connection.prototype._send checks _closed, silently returns).
This manifests itself in some number of requests succeeding, and then suddenly no more requests succeed, with no error.
I've fixed it locally by having the connection emit a new event "closed". Endpoint re-emits this event, and Agent finally handles it by removing the closed endpoint/connection from Agent.endpoints.
After a server closes the connection, the connection is marked as closed, but the connection is kept in the endpoint[key] cache.
Later requests to send data over that connection fail silently (Connection.prototype._send checks _closed, silently returns).
This manifests itself in some number of requests succeeding, and then suddenly no more requests succeed, with no error.
I've fixed it locally by having the connection emit a new event "closed". Endpoint re-emits this event, and Agent finally handles it by removing the closed endpoint/connection from Agent.endpoints.