Skip to content

dial-stdio hangs until write attempt before returning an error when Docker daemon is restarted #3668

@invidian

Description

@invidian

Contributing guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

When connection to Docker daemon is interrupted (e.g. via daemon restarting), dial-stdio hangs indefinitely until something is written to stdin before exiting with an error.

Expected behaviour

dial-stdio to exit immediately when Docker daemon connection is closed or to re-establish the connection.

Actual behaviour

dial-stdio hangs indefinitely until something is written to stdin before exiting with an error.

Buildx version

github.com/docker/buildx 0.31.1 a267595

Docker info

Client:
 Version:    29.2.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  0.31.1
    Path:     /usr/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  5.0.2
    Path:     /usr/lib/docker/cli-plugins/docker-compose
  scan: Docker Scan (Docker Inc.)
    Version:  0.9.0
    Path:     /home/invidian/.docker/cli-plugins/docker-scan

Server:
 Containers: 23
  Running: 4
  Paused: 0
  Stopped: 19
 Images: 10
 Server Version: 29.2.1
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: dea7da592f5d1d2b7755e3a161be07f43fad8f75.m
 runc version:
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.18.3-zen1-1-zen
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.08GiB
 Name: dellxps15mateusz
 ID: RA6A:HWDG:AOTK:PDDB:N2SE:VGNB:GTVU:GR2A:MTIO:7NCA:JMPF:IT5I
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
 Firewall Backend: iptables

Builders list

NAME/NODE     DRIVER/ENDPOINT   STATUS    BUILDKIT   PLATFORMS
default*      docker
 \_ default    \_ default       running   v0.27.1    linux/amd64 (+3), linux/arm64, linux/arm (+2), linux/ppc64le, (6 more)

Configuration

  1. Run docker buildx dial-stdio --progress=plain in terminal A.
  2. Wait until connection to builder is established.
  3. Run sudo systemctl restart docker in terminal B.
  4. Observe the hang.
  5. Hit enter in terminal A.
  6. Builder should print #1 ERROR: write unix @->/run/docker.sock: write: broken pipe.

Build logs


Additional info

Discovered when Dalec integration tests has been hanging (project-dalec/dalec#970) because of a bug in source policies which caused Docker daemon to crash.

Refs project-dalec/dalec#972

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions