-
Notifications
You must be signed in to change notification settings - Fork 32
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
Support running with no timeout, ignore/deprecate TIMEOUT task param #2229
base: main
Are you sure you want to change the base?
Support running with no timeout, ignore/deprecate TIMEOUT task param #2229
Conversation
When running in a Tekton task it's better if Tekton handles the timeout, so that's why we want to be able to do this. I decide to skip the context.WithTimeout entirely rather than just set it to 100 years or whatever. Ref: https://issues.redhat.com/browse/EC-1030
277cfc5
to
e374d06
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2229 +/- ##
==========================================
- Coverage 72.42% 72.42% -0.01%
==========================================
Files 88 88
Lines 7539 7546 +7
==========================================
+ Hits 5460 5465 +5
- Misses 2079 2081 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
cmd/root/root_cmd.go
Outdated
var cancel context.CancelFunc | ||
if globalTimeout > 0 { | ||
ctx, cancel = context.WithTimeout(ctx, globalTimeout) | ||
log.Debugf("globalTimeout is %d seconds", globalTimeout/time.Second) |
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.
A bit nicer way would be this:
log.Debugf("globalTimeout is %d seconds", globalTimeout/time.Second) | |
log.Debugf("globalTimeout is %s seconds", time.Duration(globalTimeout)) |
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.
Nice, thanks.
It's a little more user friendly this way.
Ignore the TIMEOUT param. Mention in the param description that it's now ignored and deprecated. Ref: https://issues.redhat.com/browse/EC-1030
e374d06
to
03d8150
Compare
@@ -224,7 +226,8 @@ spec: | |||
- "$(params.WORKERS)" | |||
# NOTE: The syntax below is required to negate boolean parameters | |||
- "--info=$(params.INFO)" | |||
- "--timeout=$(params.TIMEOUT)" | |||
# No timeout for EC, though Tekton may apply a timeout | |||
- "--timeout=0" |
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.
This works quite badly on any version of EC that doesn't have this PR merged. It's probably fine (???), but I was considering using --timeout=100h
for a while just to be extra cautious/paranoid.
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.
We can't release this version of the task without the new version of EC
See commits for details.
Ref: https://issues.redhat.com/browse/EC-1030