-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: optional command timeout field in config file that defaults to syncTimeout #3228
Conversation
@stefanprodan could I get a review on this? Would you be open to a schema change like this? |
@stefanprodan ping |
ping @hiddeco |
@stefanprodan Any movement on this? This is blocking us as well. |
@squaremo We're running into this bug as well. We are running a build of this PR in one of our clusters now, and it seems to be resolving the issue. Any chance this PR could be merged? |
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.
Thanks for putting time into this! I appreciate the need, and I'm happy with the idea. Passing the default timeout is a bit awkward, as you mention; I'm fine with it though, at least it's obvious what's happening.
There's some bits in the implementation that need another look, which I've flagged up.
I've rebased this, and added a commit for using |
Awesome Thanks! |
@marshallford Can you do me a quick favour? We now require a DCO (as of today!). It's pretty easy to apply it -- instructions are in that link, and you will need to git reset your local branch head first, to pick up my rebase. |
This gives more flexibility to .flux.yaml authors, by letting them give a timeout (as a duration e.g., `"30s"`) for each command individually. Signed-off-by: Marshall Ford <inbox@marshallford.me>
Brill, thank you @marshallford! |
Adds the ability to set an optional timeout duration for all commands that defaults to the sync timeout instead of
time.Minute
. Attempts to resolve: #3049. Keep in mind that in order to fix the issue described, the sync timeout must be greater than or equal to the sum of the generator command timeouts. I am open to ideas or to scraping this completely. Thanks Flux team!Example:
Couple of other notes:
I looked into parsingtimeout
from the config yaml as the typetime.Duration
instead of a string but the use of theghodss/yaml
package made that a bit confusing (for a new golang user anyway). It would have been nice to return an error inParseConfigFile
if an invalid duration was given instead of using the syncTimeout as a default without notice.Solved by C&P this snippet: https://stackoverflow.com/a/48051946
defaultTimeout
to theconfigAware
struct. Open to suggestions on how to improve passing through the sync timeout.TODO: