Skip to content

THRIFT-6120: Bound Ruby TLS accept handshakes#3669

Open
kpumuk wants to merge 1 commit into
apache:masterfrom
kpumuk:rb-tls-accept-timeout
Open

THRIFT-6120: Bound Ruby TLS accept handshakes#3669
kpumuk wants to merge 1 commit into
apache:masterfrom
kpumuk:rb-tls-accept-timeout

Conversation

@kpumuk

@kpumuk kpumuk commented Jul 24, 2026

Copy link
Copy Markdown
Member

SSLServerSocket previously applied its client timeout only after OpenSSL had completed the TLS handshake. A TCP peer that remained silent or stopped partway through negotiation could therefore keep accept blocked beyond the configured timeout.

This change separates TCP acceptance from TLS negotiation and drives the handshake nonblockingly against one monotonic deadline. Connections that time out, fail, or are interrupted before ownership transfers to the returned transport are closed. Successful connections continue to be returned as Thrift::Socket instances with the configured client timeout.

NonblockingServer and ThreadPoolServer now treat TLS handshake errors as recoverable accept failures, matching the existing behavior of the simple and threaded servers. The thread-pool server retries from the same worker instead of reporting the handshake failure as a worker exception. The optional OpenSSL check remains guarded so directly loaded plain-TCP server components preserve unrelated accept errors when OpenSSL has not been loaded.

  • Did you create an Apache Jira ticket? THRIFT-6120
  • 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.

Copilot AI review requested due to automatic review settings July 24, 2026 01:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mergeable mergeable Bot added the ruby Pull requests that update Ruby code label Jul 24, 2026
@kpumuk
kpumuk marked this pull request as draft July 24, 2026 02:10
@kpumuk
kpumuk force-pushed the rb-tls-accept-timeout branch from 8c67835 to 1f339e2 Compare July 24, 2026 03:10
Client: rb

Co-Authored-By: OpenAI Codex (GPT-5.6) <codex@openai.com>
@kpumuk
kpumuk force-pushed the rb-tls-accept-timeout branch from 1f339e2 to f2256c7 Compare July 26, 2026 02:29
@kpumuk
kpumuk marked this pull request as ready for review July 26, 2026 02:50
Copilot AI review requested due to automatic review settings July 26, 2026 02:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kpumuk

kpumuk commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

Copilot, you are not helping.

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.

2 participants