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

Support running with no timeout, ignore/deprecate TIMEOUT task param #2229

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

simonbaird
Copy link
Member

See commits for details.

Ref: https://issues.redhat.com/browse/EC-1030

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
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 72.42%. Comparing base (52d753b) to head (03d8150).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
cmd/root/root_cmd.go 80.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
generative 72.42% <80.00%> (-0.01%) ⬇️
integration 72.42% <80.00%> (-0.01%) ⬇️
unit 72.42% <80.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cmd/root/root_cmd.go 51.92% <80.00%> (+1.40%) ⬆️

var cancel context.CancelFunc
if globalTimeout > 0 {
ctx, cancel = context.WithTimeout(ctx, globalTimeout)
log.Debugf("globalTimeout is %d seconds", globalTimeout/time.Second)
Copy link
Member

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:

Suggested change
log.Debugf("globalTimeout is %d seconds", globalTimeout/time.Second)
log.Debugf("globalTimeout is %s seconds", time.Duration(globalTimeout))

Copy link
Member Author

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
@@ -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"
Copy link
Member Author

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.

Copy link
Member

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

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