Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a smaller retry delay on HTTP requests #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nickdichev-firework
Copy link
Contributor

By default Req uses a retry strategy of waiting 1000,2000,4000,8000ms between retries. This can really hurt pipeline startup latency if we are starting the LC on pipeline startup.

{:ok, _} = Application.ensure_all_started(:req)

retry_delay_ms = fn retry_count -> retry_count * 100 end
req = Req.new(base_url: "http://#{@local_host_url}:#{lc_port}", retry_delay: retry_delay_ms)
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the concern is about the startup time, then I assume that /status requests are the main problem here. When we spawn an instance we try to send a status request and already have retry logic there, so I think a better approach here would be to disable retry entirely, but just on the /status endpoint.

But overall I don't see any problem with this approach (only the status endpoint is currently affected because POST requests are not retried), so I'm fine with leaving it as it is.

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