Skip to content

[BUG] Deadlock on recreation of logging container #12103

@smoehrle

Description

@smoehrle

Description

See example below. We have a fluentbit container and an app container which uses the fluentbit container in its logging configuration. If there is anything which triggers a recreation of the fluentbit container, the following happens:

  • Fluentbit is recreated, waits with status created, is not running
  • Depends-on triggers a recreation of the app which tries to terminate, but cannot since the log driver is blocking the termination (can only terminate when fluentbit is available)

Workaround: run docker start [project-name]-fluentbit-1 in a second terminal

Expected behaviour: No deadlock

Steps To Reproduce

# compose.yml
services:
  fluentbit:
    image: fluent/fluent-bit:3.1.7-debug
    ports:
      - "24224:24224"
      - "24224:24224/udp"
    environment:
      FOO: ${BAR}

  app:
    image: nginx
    depends_on:
      - fluentbit
    logging:
      driver: fluentd
      options:
        fluentd-address: 127.0.0.1:24224
# test.txt
BAR=test
  1. docker compose up -d
  2. docker compose --env-file test.txt up -d
    • Second command can be anything that triggers a recreate of the fluentbit container.

Compose Version

Docker Compose version v2.24.5

Docker Environment

Client: Docker Engine - Community
 Version:    25.0.2
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.5
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 373
  Running: 3
  Paused: 0
  Stopped: 370
 Images: 770
 Server Version: 25.0.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 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
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc runsc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.5.0-44-generic
 Operating System: Ubuntu 23.10
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 30.12GiB
 Name: stefan-lenovo-x13
 ID: 9fa19f06-02fc-4ec3-a95b-28a56edf479e
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Default Address Pools:
   Base: 172.17.0.0/12, Size: 20
   Base: 192.168.0.0/16, Size: 24

Anything else?

No response

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