Skip to content

Close SocketChannel on pre-registration failure in TlsChannelStream#1981

Open
rozza wants to merge 3 commits into
mongodb:mainfrom
rozza:JAVA-6216
Open

Close SocketChannel on pre-registration failure in TlsChannelStream#1981
rozza wants to merge 3 commits into
mongodb:mainfrom
rozza:JAVA-6216

Conversation

@rozza
Copy link
Copy Markdown
Member

@rozza rozza commented May 21, 2026

Resolve address before opening SocketChannel to avoid FD leak on DNS failure. Close the channel in catch blocks if opened but not yet registered with the selector monitor. Cancel pending registration action to prevent races with the timeout scheduler.

JAVA-6216

Resolve address before opening SocketChannel to avoid FD leak on DNS
failure. Close the channel in catch blocks if opened but not yet
registered with the selector monitor. Cancel pending registration action
to prevent races with the timeout scheduler.

JAVA-6216

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rozza rozza requested a review from a team as a code owner May 21, 2026 09:00
@rozza rozza requested a review from stIncMale May 21, 2026 09:00
@rozza
Copy link
Copy Markdown
Member Author

rozza commented May 21, 2026

This is #1972 reworked slightly and assigned to a new ticket.

@rozza rozza mentioned this pull request May 21, 2026
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