Skip to content

Close sockets when option setup fails - #318

Closed
OskarEichler wants to merge 1 commit into
redis-rb:masterfrom
OskarEichler:codex/close-socket-option-failure
Closed

Close sockets when option setup fails#318
OskarEichler wants to merge 1 commit into
redis-rb:masterfrom
OskarEichler:codex/close-socket-option-failure

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Assign the TCP socket to the method-owned variable before configuring options so the existing ensure path closes it if setsockopt or keepalive setup raises.

Verification: a forced keepalive failure retained an open descriptor before and closes it afterward; focused checks, Ruby 4.0.6 syntax, RuboCop, and gem build pass. Source-only patch; no tests included.

@byroot byroot closed this Aug 30, 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.

2 participants