-
Notifications
You must be signed in to change notification settings - Fork 726
Client does not handle connections being closed by the server in all cases #2605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If you look at the HttpConnection class, it handles several events that may be raised by the request, response and socket objects during the lifecycle of an HTTP request. My concern is that ECONNRESET is only handled during an aborted request, but not other types of requests, and I'm working on writing unit tests to reproduce the current failure case, and then will work on implementing a fix. |
I've been working on this for a few days now and haven't fully narrowed in on an exact fix yet, unfortunately. The issue turns out to be very hard to pin down, in large part because the Node So, I've been doing some refactoring work on Thanks for your patience, to anyone following along. I know this issue has been a blocker to some downstream work in Serverless, so I'm working as quickly and carefully as I can. |
Update: still working on this. Getting closer, but it's been very hard to unravel the order of events without breaking existing functionality. 😓 |
Just merged a fix in elastic/elastic-transport-js#223. Will publish |
transport 8.9.5-beta.1 is now available on npm |
When sending a bulk request that is larger than Elasticsearch is configured to accept, it will respond with a
413 Content Too Large
and close the connection. When the client usesHttpConnection
as its connection type andClusterConnectionPool
as its pool type, it does not appropriately handle when the connection is closed by the server. That socket will stay in the pool and may be used by a subsequent request, raising aread ECONNRESET
orEPIPE
exception when trying to send a request over a closed connection.It has not yet been verified whether the same happens when using
UndiciConnection
or other pool types, so all combinations may need to be tested.From @rudolf while reporting on this issue:
The text was updated successfully, but these errors were encountered: