amplitude / amplitude/experiment-ruby-server

Add open_timeout_millis configuration to AmplitudeExperiment::RemoteEvaluationConfig

Offen
#71 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Ruby
Sterne
3
Forks
6
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Summary

Currently, `AmplitudeExperiment::RemoteEvaluationConfig` allows configuring only `read_timeout` through the `fetch_timeout_millis` parameter.

Could you add `open_timeout_millis` to `AmplitudeExperiment::RemoteEvaluationConfig` to allow configuring the connection opening timeout?

```
config = AmplitudeExperiment::RemoteEvaluationConfig.new(
fetch_timeout_millis: 5000, # Read timeout
open_timeout_millis: 5000 # Open timeout (New)
)
```

A related discussion about this missing configuration occurred here:
[Issue #41 - Comment](https://github.com/amplitude/experiment-ruby-server/issues/41#issuecomment-1589858655).

## Motivations

Occasionally, requests to Amplitude fail due to excessive time required to establish a connection:

```
Failed to open TCP connection to api.lab.amplitude.com:443 (execution expired)"
```

Currently, the `open_timeout` value is not configurable and defaults to **60 seconds**, which can lead to a thread being blocked for an extended period. This impacts application performance, especially in multi-threaded environments where long waits can cause delays in processing other requests.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.