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

http client timeout config #131

Merged
merged 4 commits into from
Jul 14, 2022
Merged

Conversation

ncode
Copy link
Contributor

@ncode ncode commented Aug 24, 2021

Simple change to allow set http timeout via driver config.

Fix #100

Copy link
Member

@jrasell jrasell left a 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:

@ncode
Copy link
Contributor Author

ncode commented Aug 25, 2021

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:

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.

@ncode
Copy link
Contributor Author

ncode commented Aug 25, 2021

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.

@sycured
Copy link

sycured commented Feb 27, 2022

Any ETA about merge/release?

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@jdoss
Copy link
Contributor

jdoss commented Jun 9, 2022

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.

@lgfa29 lgfa29 force-pushed the ncode/client_timeout branch from ee494fd to 9ae4803 Compare July 14, 2022 23:57
Copy link
Contributor

@lgfa29 lgfa29 left a 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!

@lgfa29 lgfa29 merged commit 09a7043 into hashicorp:main Jul 14, 2022
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.

Pulling images fails after 1 minute due to Timeout
6 participants