Skip to content

fix: close pooled TLS before GCP LB idle timeout [CHA-4943] - #78

Merged
itsmeadi merged 3 commits into
masterfrom
cha-4943-ruby-gcp-idle-timeout
Aug 24, 2026
Merged

fix: close pooled TLS before GCP LB idle timeout [CHA-4943]#78
itsmeadi merged 3 commits into
masterfrom
cha-4943-ruby-gcp-idle-timeout

Conversation

@itsmeadi

Copy link
Copy Markdown
Collaborator

Ticket

Summary

GCP SSL-proxy load balancers close idle TLS around ~30s. getstream-ruby kept net_http_persistent connections for 55s (AWS ALB idle minus 5s), so the next request failed with SSL_read: unexpected eof while reading and no matching API 5xx. Default idle_timeout is now 25s so the client drops the connection first.

Reproduced 3/3 at 35s idle against staging chat-edge-us-east1-ce1.gcp.stream-io-api.com with the old default; the new keep-alive spec passes at 35s with idle_timeout=25.

Until this ships, customers can set idle_timeout: 10 or faraday_adapter: :net_http.

Test plan

  • Unit specs for default idle_timeout=25
  • STREAM_BASE_URL=https://chat-edge-us-east1-ce1.gcp.stream-io-api.com make test-integration-gcp-lb (35s idle, same client)
  • Optional CI job runs when STREAM_GCP_BASE_URL is set on the ci GitHub environment

Notes

  • Workaround for PrizePicks (Zendesk 82933) until they upgrade: idle_timeout: 10 or disable pooling.
  • To run the GCP job in CI, set STREAM_GCP_BASE_URL (and optionally STREAM_GCP_API_KEY / STREAM_GCP_API_SECRET) on the ci environment.

Made with Cursor

GCP SSL-proxy load balancers close idle TLS around 30s while the SDK
kept net_http_persistent connections for 55s, causing SSL_read EOF on
the next request. Default idle_timeout is now 25s.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread spec/integration/gcp_lb_keepalive_spec.rb Fixed
Job-level if: vars.STREAM_GCP_BASE_URL is evaluated before the ci
environment is applied, so environment variables never un-skip the job.
The spec still skips unless STREAM_BASE_URL is a GCP edge hostname.

Co-authored-by: Cursor <cursoragent@cursor.com>
@itsmeadi itsmeadi changed the title [CHA-4943] Close pooled TLS before GCP LB idle timeout fix: close pooled TLS before GCP LB idle timeout [CHA-4943] Aug 24, 2026
@itsmeadi
itsmeadi merged commit 39e6f9e into master Aug 24, 2026
8 checks passed
@itsmeadi
itsmeadi deleted the cha-4943-ruby-gcp-idle-timeout branch August 24, 2026 17:00
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