-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
enforce context timeout on build log streaming #15944
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,6 +186,12 @@ func (r *REST) Get(ctx apirequest.Context, name string, opts runtime.Object) (ru | |
// until they have all run, unless we see one of them fail. | ||
// If we aren't following the logs, we will run through all the init containers exactly once. | ||
for waitForInitContainers { | ||
select { | ||
case <-ctx.Done(): | ||
glog.V(4).Infof("timed out while iterating on build init containers for build pod %s/%s", build.Namespace, buildPodName) | ||
return | ||
default: | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like line 195 should be before the select? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we shouldn't log that we're iterating through the containers if we aren't going to iterate through the containers because the context timed out. |
||
glog.V(4).Infof("iterating through build init containers for build pod %s/%s", build.Namespace, buildPodName) | ||
|
||
// assume we are not going to need to iterate again until proven otherwise | ||
|
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.
iterating through build init ...
to be consistent with the wording in line 195
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.
log level 4....