-
Notifications
You must be signed in to change notification settings - Fork 64
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
http client timeout config #131
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ncode and thanks for taking the time to raise this PR. The code looks good, however, I am wary of the approach as the timeout parameter is set at the plugin level and therefore will impact every HTTP call made.
We had a similar problem on the Docker driver which we solved by adding a config parameter within the job specification driver config itself. This allows overriding this setting per image, rather than on the whole driver. I wonder how you feel about this approach as an addition to the client setting?
The relevant code to this potential approach:
- api.ImagePull which accepts a context
- driver calls ImagePull passing a context
Hi @jrasell, I think the timeout set on the task level sounds better and makes the configuration more granular, so I'm happy to change it. The suggestion from #100 points to plugin level so I followed it :). I will update the PR with the proposed changes. |
Hi @jrasell, I've implemented image_pull_timeout, but I also help the client_http_timeout. We need to use both to be able to achieve the timeout from the task. Since the default timeout on the driver for http requests is set to 60s, the context with timeout will drop without the increase. It would be possible to do something similar to https://github.com/hashicorp/nomad/blob/main/api/api.go#L319, but since my previous change helped I decided to keep it. |
Any ETA about merge/release? |
This feature would be great to have. I am trying to launch a ton of Podman containers across a large Nomad cluster and being able to set the timeout would help out a lot. |
Allows to configure the http timeout via driver config.
ee494fd
to
9ae4803
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for getting so long to get this reviewed. I rebased on main
to get the latest code changes and fix the conflicts.
Thank you so much for the contribution!
Simple change to allow set http timeout via driver config.
Fix #100