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

enforce context timeout on build log streaming #15944

Merged
merged 1 commit into from
Aug 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/build/registry/buildlog/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

@coreydaley coreydaley Aug 24, 2017

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log level 4....

return
default:
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like line 195 should be before the select?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
Expand Down