Skip to content

[Bug]: A lock on an unused volume alternative can fail a job #4554

Backlog

Description

@peterschmidt85

Steps to reproduce

  1. In one project, configure a GCP volume named gcp-data and an AWS volume named aws-data. Use an AWS instance in the AWS volume’s region.

  2. Start a GCP job that mounts gcp-data.

  3. While the GCP attachment is in progress, schedule a second job on the AWS instance with these alternatives for one mount point.

    volumes:
      - name: [gcp-data, aws-data]
        path: /data

To reproduce the overlap deterministically in a worker test, pause the first job’s compute.attach_volume() after it acquires its volume lock. Process the AWS job and then let the first call finish.

Actual behaviour

The AWS job enters TERMINATING with VOLUME_ERROR and the message Failed to attach volume: Cannot attach a volume locked for processing. Its backend never receives an attach request. The GCP job continues normally.

The submitted-job worker takes locks on all configured alternatives before selecting the volume for the assigned instance. Worker

Expected behaviour

The AWS job can attach aws-data while the GCP job attaches gcp-data.

dstack version

master (e7645afd1). Reproduced with two submitted-job workers on SQLite and PostgreSQL and mocked provider attach calls.

Activity

  1. added
    bug
    on Nov 27, 2026
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

    bugvolumes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions