Fix "double socket close" issue with Windows version of TCPConnection #4437
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.
When fixing a number of "smaller" Windows TCP networking issues a couple years
back, in addition to fixing those issues, we introduced a new bug. That bug
lingered for two years. It lingered in large part because it would only become
apparent in a low resource environment.
When we recently switched our Windows CI from CirrusCI to GitHub Actions, we
went from a high-resource environment to a low-resource environment and started
getting a ton of "random" Windows TCP test failures.
The problem that was fairly easy to recreate in a test environment would be
fairly unlikely in most applications but existed nontheless. The scenario in
our test environment was like this:
with OS, but doesn't reset its own internal record of the file descriptor
for the socket.
just closed by Test 1
closes the socket associated with "its" file descriptor. When Test 1 does
this, test 2's socket closes and the test fails to complete successfully.
The problem would appear "in the wild" if a Windows application was quickly
closing and opening TCP sockets in a manner similiar to the Pony standard
library TCP tests.
Fixes #4413
Fixes #4435