Skip to content

THRIFT-5949: Add default timeout to Ruby server sockets#3494

Merged
kpumuk merged 1 commit into
apache:masterfrom
kpumuk:rb-server-timeout
May 19, 2026
Merged

THRIFT-5949: Add default timeout to Ruby server sockets#3494
kpumuk merged 1 commit into
apache:masterfrom
kpumuk:rb-server-timeout

Conversation

@kpumuk
Copy link
Copy Markdown
Member

@kpumuk kpumuk commented May 18, 2026

This change adds a keyword argument client_timeout to all server sockets:

# Default timeout is 5 seconds
socket = Thrift::ServerSocket.new(1234)
# Reduce the server timeout to 2.5 seconds
socket = Thrift::ServerSocket.new(1234, client_timeout: 2.5)
# Pass nil to remove the timeout, reverting to pre-0.24.0 behavior
socket = Thrift::ServerSocket.new(1234, client_timeout: nil)

This is the first time Thrift Ruby library uses keyword arguments. The reason for this is to align with the upcoming switch of all public interfaces to keyword arguments, and better handle optional arguments (so you don't need to pass all other positional args to change the client timeout).

  • Did you create an Apache Jira ticket? THRIFT-5949
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

@mergeable mergeable Bot added the ruby Pull requests that update Ruby code label May 18, 2026
@kpumuk kpumuk merged commit d76e5cf into apache:master May 19, 2026
98 checks passed
@kpumuk kpumuk deleted the rb-server-timeout branch May 19, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ruby Pull requests that update Ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant