Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1359199 - Race condition using docker exec with tty
Summary: Race condition using docker exec with tty
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Lokesh Mandvekar
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-22 13:43 UTC by Andy Goldstein
Modified: 2019-03-06 01:00 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-03 20:56:57 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1446 normal SHIPPED_LIVE docker bug fix and enhancement fix update 2016-08-05 19:34:58 UTC

Description Andy Goldstein 2016-07-22 13:43:44 UTC
Description of problem: Sometimes when running 'docker exec -it ...', output from the command is lost.


Version-Release number of selected component (if applicable): 1.10.3-44.el7


How reproducible: easily


Steps to Reproduce:
1. docker run -d --name c7 centos:centos7 sleep 9999999
2. while true; do x=$(docker exec -t c7 cat /etc/hosts); if [ -z "${x}" ]; then break; fi; done

Actual results: the while loop exits


Expected results: the while loop should not exit


Additional info:

If you remove the -t (docker exec c7 cat /etc/hosts), there is no issue.

This is fixed by https://github.com/docker/docker/pull/21018

Comment 3 Luwen Su 2016-07-25 08:56:35 UTC
Wors well for me in docker-1.10.3-46.el7.8.x86_64,
I wait for a moment to see the ouput, but the ``while`` ends.

# while true; do x=$(docker exec -t c9 cat /etc/hosts); echo ${x} ;if [ -z "${x}" ]; then break; fi; done
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
 172.17.0.2 7aeb15a8df81host ip6-loopback
.....

Comment 5 errata-xmlrpc 2016-08-03 20:56:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-1446.html


Note You need to log in before you can comment on or make changes to this bug.