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

Calling HijackResponse.CloseWrite from ContainerAttach causes EOF on read side too #38457

Open
segevfiner opened this issue Dec 31, 2018 · 1 comment

Comments

@segevfiner
Copy link

segevfiner commented Dec 31, 2018

Description

Calling HijackedConnection.CloseWrite, on the stream returned from ContainerAttach, causes EOF on the stream read side too.

Steps to reproduce the issue:

git clone https://github.com/segevfiner/docker-attach-closewrite-bug
docker build -t docker-attach-closewrite image
go run .
go run . -close-write

Describe the results you received:
The first go run shows the output from the container correctly. The second, which calls CloseWrite, doesn't.

Describe the results you expected:
Both go run calls should show the same correct output.

Additional information you deem important (e.g. issue happens only occasionally):
Also reproduced on macOS with Docker for Mac.

Output of docker version:

Client:
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:49:01 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:16:44 2018
  OS/Arch:          linux/amd64
  Experimental:     false

Output of docker info:

Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 6
Server Version: 18.09.0
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: c4446665cb9c30056f4998ed953e6d4ff22c7c39
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: fec3683
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.15.0-43-generic
Operating System: Ubuntu 18.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.852GiB
Name: REDACTED
ID: REDACTED
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.):
Reproduced on a Ubuntu 18.04.1 x64 VM, and on a physical MacBook with macOS 10.14.2 and Docker for Mac at 18.06.1 and 18.09.0.

@shay-k
Copy link

shay-k commented Sep 24, 2020

This only happens when StdinOnce is not set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants