test: Add test for FIN mishandling in http agent #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refs: nodejs#47130
This is an example test which fails with
socket hang up
when a socket is re-used. It's probably not a 100% guaranteed repo, but it seems pretty high %age failure (> 95%) to me.This code is purposefully messy, and is NOT intended for merging upstream. It's instead intended as a reproduction of the claimed issue, and as a tool to be able to understand the problem.
An example error from the test is below.
I believe too much time is allowed to pass between the socket receiving the FIN and the http agent removing the socket from its pool of sockets the agent can route to. This results in the agent re-using the socket in the meantime, where-upon the agent realises and returns an error with
socket hang up
(it appears this happens in the agent before the request is even sent on the socket).