Skip to content

Win32: recycle failed AcceptEx connections#1276

Open
erhan1209 wants to merge 1 commit into
nginx:masterfrom
erhan1209:fix/win32-acceptex-recycle-failures
Open

Win32: recycle failed AcceptEx connections#1276
erhan1209 wants to merge 1 commit into
nginx:masterfrom
erhan1209:fix/win32-acceptex-recycle-failures

Conversation

@erhan1209
Copy link
Copy Markdown

Proposed changes

ngx_event_acceptex() had several error exits that logged and returned without closing the accepted connection or reposting a replacement AcceptEx request. On Win32, repeated failures in these paths could leak connection resources and reduce listener capacity over time.

This change introduces a small recycle helper that closes the failed posted connection and reposts a replacement AcceptEx request.

The helper is now used for:

  • overlapped AcceptEx completion errors
  • SO_UPDATE_ACCEPT_CONTEXT failures
  • address text allocation failures
  • ngx_sock_ntop() failures

This keeps the listener accepting new connections even when these edge-case failures occur.

Windows compile validation is expected from CI/buildbot. Runtime verification of the AcceptEx failure path has not been performed locally.

Checklist

`ngx_event_acceptex()` had several error exits that logged and returned without closing the accepted connection or reposting a replacement AcceptEx request. On Win32, repeated failures in these paths could leak connection resources and reduce listener capacity over time.

This change introduces a small recycle helper that:
- closes the failed posted connection
- reposts a replacement AcceptEx request

The helper is now used for:
- overlapped AcceptEx completion errors
- `SO_UPDATE_ACCEPT_CONTEXT` failures
- address text allocation failures
- `ngx_sock_ntop()` failures

This keeps the listener accepting new connections even when these edge-case failures occur.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

✅ All required contributors have signed the F5 CLA for this PR. Thank you!
Posted by the CLA Assistant Lite bot.

@erhan1209
Copy link
Copy Markdown
Author

I have hereby read the F5 CLA and agree to its terms

@erhan1209
Copy link
Copy Markdown
Author

recheck

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