Skip to content

baggageclaim: overlay driver Recover() stacks bind-mounts on each in-place restart → ENOSPC crash loop #9722

Closed

Description

@Kump3r

Summary

On workers using the overlay baggageclaim driver, every in-place process restart
(e.g. BOSH in-place update, monit restart) adds a full new layer of bind/overlay
mounts on top of the previous run's mounts without checking whether they already
exist. Over N restarts with V on-disk volumes, the mount table grows to N × V
entries. Once it hits the kernel per-mount-namespace limit the next mount(2) call
returns ENOSPC, Recover() aborts, and the worker crash-loops under monit, which
restarts it again and stacks another layer. Self-reinforcing.

Related: #7430 ("worker does not recover if volume is still mounted")

Steps to Reproduce

  1. Run a Concourse worker with --baggageclaim-driver=overlay.
  2. Execute several pipelines to create volumes under $CONCOURSE_WORK_DIR/volumes/live/.
  3. Without destroying the VM, restart only the worker process: sudo /var/vcap/bosh/bin/monit restart worker
    Repeat step 3 five or more times.
  4. Observe: mount | grep "$CONCOURSE_WORK_DIR" | wc -l Each restart multiplies the count by (1 + previous).
  5. Continue restarting until ENOSPC is returned; worker enters crash loop.

Expected Results

No response

Actual Results

Example:

worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/bosh_ssh/bosh_2ab78393b77346a# mount | grep "$CONCOURSE_WORK_DIR" | wc -l
182
worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/bosh_ssh/bosh_2ab78393b77346a# monit restart worker
worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/bosh_ssh/bosh_2ab78393b77346a# mount | grep "$CONCOURSE_WORK_DIR" | wc -l
386
worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/bosh_ssh/bosh_2ab78393b77346a# monit restart worker
worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/bosh_ssh/bosh_2ab78393b77346a# mount | grep "$CONCOURSE_WORK_DIR" | wc -l
758
worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/bosh_ssh/bosh_2ab78393b77346a# monit restart worker
worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/bosh_ssh/bosh_2ab78393b77346a# mount | grep "$CONCOURSE_WORK_DIR" | wc -l

Web Node(s) configuration

No response

Worker(s) configuration

CONCOURSE_BAGGAGECLAIM_DRIVER=overlay

Concourse Version

8.3.0

Browser (if applicable)

No response

Did this use to work?

No response

Activity

  1. Kump3r commented on Sep 17, 2026

    @Kump3r
    ContributorAuthor

    Possible RC:
    Two defects in worker/baggageclaim/volume/driver/overlay_linux.go:
    Defect 1 - bindMount() is not idempotent (line 200–218) - No check: is mountPath already mounted?
    Defect 2 - Recover() does not roll back mounts on error (line 115–162)

    Possible temporary workaround: use create-swap-delete bosh strategy instead, or recreate workers regularly

  2. kristianstanchev commented on Sep 17, 2026

    @kristianstanchev
    Contributor

    Example error message in production:

    {"timestamp":"2026-09-17T11:27:05.773012935Z","level":"error","source":"worker","message":"worker.baggageclaim.failed-to-recover-volume-driver","data":{"error":"recover bind mount: no space left on device","session":"2"}}
    {"timestamp":"2026-09-17T11:27:26.028301997Z","level":"error","source":"worker","message":"worker.baggageclaim.failed-to-recover-volume-driver","data":{"error":"recover bind mount: no space left on device","session":"2"}}
    {"timestamp":"2026-09-17T11:27:46.180025145Z","level":"error","source":"worker","message":"worker.baggageclaim.failed-to-recover-volume-driver","data":{"error":"recover bind mount: no space left on device","session":"2"}}
    {"timestamp":"2026-09-17T11:28:06.427830771Z","level":"error","source":"worker","message":"worker.baggageclaim.failed-to-recover-volume-driver","data":{"error":"recover bind mount: no space left on device","session":"2"}}
    
  3. Kump3r commented on Sep 18, 2026

    @Kump3r
    ContributorAuthor

    Validated the fix by compiling the binary and switching on the bosh VM, with the same steps described above:

    worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/packages/concourse/bin# mount | grep "$CONCOURSE_WORK_DIR" | wc -l
    225
    worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/packages/concourse/bin# monit restart worker
    worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/packages/concourse/bin# mount | grep "$CONCOURSE_WORK_DIR" | wc -l
    229
    worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/packages/concourse/bin# mount | grep "$CONCOURSE_WORK_DIR" | wc -l
    232
    worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/packages/concourse/bin# monit restart worker
    worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/packages/concourse/bin# mount | grep "$CONCOURSE_WORK_DIR" | wc -l
    238
    worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/packages/concourse/bin# monit restart worker
    worker/fa3d0fb7-3650-4e4c-a375-830664466ce8:/var/vcap/packages/concourse/bin# mount | grep "$CONCOURSE_WORK_DIR" | wc -l
    238
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions