Skip to content

backport: discard disconnected accepted sockets for 0.6 - #1

Merged
kentbull merged 3 commits into
release/v0.6.20from
backport/accepted-socket-disconnect-v0.6.20
Aug 24, 2026
Merged

backport: discard disconnected accepted sockets for 0.6#1
kentbull merged 3 commits into
release/v0.6.20from
backport/accepted-socket-disconnect-v0.6.20

Conversation

@kentbull

@kentbull kentbull commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Ports the accepted-socket recovery fix from ioflo/hio#166 to the GLEIF Python 3.12-compatible 0.6 maintenance line.

A peer may disconnect after accept() but before serviceAxes() inspects its addresses. Close and discard an unusable accepted socket without terminating the listener, and continue servicing later healthy connections.

The regression coverage matches the final upstream test: it retains real accepted sockets but mocks the platform-dependent getpeername() failure, avoiding reliance on operating-system-specific TCP RST timing.

Base: release/v0.6.20, including the merged UDP loopback test correction.

Focused validation: Python 3.13 TCP module, 14 passed.

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.
Bring the merged UDP loopback test correction into this branch so CI evaluates the TCP socket-disconnect backport against the current 0.6.20 release base.
Backport the final regression test from ioflo/hio PR 166. Mock the platform-dependent getpeername failure while retaining real accepted sockets so Windows verifies the serviceAxes recovery path instead of relying on RST timing.

This changes test code only; the accepted-socket production fix is unchanged.
@kentbull
kentbull merged commit bde6319 into release/v0.6.20 Aug 24, 2026
3 checks passed
@kentbull
kentbull deleted the backport/accepted-socket-disconnect-v0.6.20 branch August 24, 2026 18:16
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.

1 participant