Skip to content

fixes #165: discard disconnected accepted sockets - #166

Open
kentbull wants to merge 1 commit into
ioflo:mainfrom
kentbull:fix/accepted-socket-disconnect-v0.7.19
Open

fixes #165: discard disconnected accepted sockets#166
kentbull wants to merge 1 commit into
ioflo:mainfrom
kentbull:fix/accepted-socket-disconnect-v0.7.19

Conversation

@kentbull

@kentbull kentbull commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

A peer may disconnect after accept() but before serviceAxes() inspects the socket addresses. getpeername() or getsockname() then raises an OSError that escapes the server loop and terminates the process.

Close and discard the disconnected socket while allowing the listener to continue. Add regression coverage for both plaintext and TLS servers that also verifies a subsequent healthy connection is accepted.

Fixes #165

@kentbull

Copy link
Copy Markdown
Contributor Author

If we want to do a 0.6.x release then this is easily cherry-pickeable to a 0.6.x branch, we just need to make said branch.

@kentbull
kentbull force-pushed the fix/accepted-socket-disconnect-v0.7.19 branch 2 times, most recently from 8980b8a to e220412 Compare August 19, 2026 18:30
A peer may disconnect after accept() but before serviceAxes() inspects
the socket addresses. getpeername() or getsockname() then raises an
OSError that escapes the server loop and terminates the process.

Close and discard the disconnected socket while allowing the listener
to continue. Add regression coverage for both plaintext and TLS servers
that also verifies a subsequent healthy connection is accepted.
@kentbull
kentbull force-pushed the fix/accepted-socket-disconnect-v0.7.19 branch from e220412 to c3e7e3d Compare August 19, 2026 18:43
kentbull added a commit to kentbull/hio that referenced this pull request Aug 20, 2026
Replace the platform-dependent TCP reset with the mocked peer-lookup failure now used by upstream PR ioflo#166. The test still exercises a failed accepted socket followed by a healthy one, while producing consistent behavior on Windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TCP server crashes when an accepted peer disconnects before serviceAxes()

1 participant