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

oc cluster up: work around docker attach race condition #12223

Merged
merged 1 commit into from
Dec 13, 2016

Conversation

jim-minter
Copy link
Contributor

Fixes #9470

Alternative to #12189

[test]

@csrwng FYI

// stdout/stderr to avoid race condition in (at least) docker 1.10-1.14-dev:
// https://github.com/docker/docker/issues/29285
glog.V(5).Infof("Attaching to container %q", id)
err = h.client.AttachToContainer(docker.AttachToContainerOptions{
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a question ... why use AttachToContainer and not Logs ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only because that's what was there before -- now changed to h.client.Logs(), thanks!

@csrwng
Copy link
Contributor

csrwng commented Dec 12, 2016

LGTM [merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 46d539f

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12273/) (Base Commit: 9ee2ff6)

@csrwng
Copy link
Contributor

csrwng commented Dec 13, 2016

#12236
[merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 46d539f

@openshift-bot
Copy link
Contributor

openshift-bot commented Dec 13, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12336/) (Base Commit: 850a41b) (Image: devenv-rhel7_5535)

@openshift-bot openshift-bot merged commit dc5b60a into openshift:master Dec 13, 2016
@bparees
Copy link
Contributor

bparees commented Jan 19, 2017

@jim-minter I think this is also causing problems in our postcommit hook logic when the postcommit hook operation is very short. Any chance you can do a PR to fsouza/go-dockerclient to patch the log streaming code there too? (Assuming i'm correct)
https://github.com/fsouza/go-dockerclient/blob/master/client.go#L510

here's where we're running the container and streaming the logs:
https://github.com/openshift/origin/blob/master/pkg/build/builder/dockerutil.go#L186-L192

@jim-minter
Copy link
Contributor Author

@bparees You might create a new issue for this. Do you have an example/replicator?
At first glance:

  • I think it's feasible that Suspected race conditions in daemon/attach.go moby/moby#29285 could cause a hang at the location you indicate if the hook is short-running.
  • I don't think any useful workaround/patch can be sent to fsouza/go-dockerclient.
  • I think our options are: a) don't stream container output, only retrieve it after container termination (that's what this PR did for oc cluster up); b) fix (or get fixed) the issue upstream in Docker.

@bparees
Copy link
Contributor

bparees commented Jan 20, 2017

@jim-minter opened #12587

the recreate its pretty simple. define a buildconfig w/ a postcommit hook. make the postcommit hook be something that's very quick like an echo command. @spadgett was able to recreate it consistently, i haven't tried myself.

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.

4 participants