Skip to content

fetch_timeout_millis does not appear to be respected for Remote Evaluation #41

Description

@therabidbanana

Reviewing traces in Datadog for HTTP requests sent by the Ruby client I can see several requests logged at 1+ second even though I've set fetch_timeout_millis to 500

Expected Behavior

config = AmplitudeExperiment::RemoteEvaluationConfig.new(fetch_timeout_millis: 500)
experiment = AmplitudeExperiment.initialize_remote(experiment_key, config)
variants = experiment.fetch(...) # expected to take <=500 milliseconds

Current Behavior

variants = experiment.fetch(...) # occasionally takes 1000+ milliseconds

Possible Solution

Either fractional seconds are not allowed, documentation is incorrect for how to set this, or we need to add additional configuration for open_timeout to the persistent http client.

https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/Net/HTTP.html#open_timeout-attribute-method

Steps to Reproduce

Hard to reproduce as it requires a slow connection to occur - might be able to fake it with network connection settings changed to simulate spotty 3G or something?

Environment

  • SDK Version: 1.1.1
  • Ruby Version: 3.1.3

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions