Skip to content

🐞 Setting --oci-max-parallelism 2 causes deadlocks #6894

Closed

Description

@gerhard

What is the issue?

Setting --oci-max-parallelism 2 on the Engine causes deadlocks, both with & without modules.

This is what that looks like from the CLI / user perspective:

dagger-0.10.2-deadlock.mp4

Attaching Dagger Engine v0.10.2 logs + SIGQUIT. Thank you @vito for https://vito.github.io/swirly/ and the tips!

FWIW:

dagger-0.10.2-sigquit-swirly.mp4

cc @sipsma @vito @jedevc @aluzzardi

Dagger version

Confirmed on 0.9.11 & 0.10.2

Steps to reproduce

No response

Log output

No response

Activity

  1. added
    kind/bug
    on Mar 16, 2024
  2. changed the title [-]🐞 Setting `--oci-max-parallelism 2` can cause deadlocks[/-] [+]🐞 Setting `--oci-max-parallelism 2` causes deadlocks[/+] on Mar 16, 2024
  3. Scalahansolo commented on Mar 28, 2024

    @Scalahansolo

    The team over here at Motion have seen this happen to us as well on 0.10.3

  4. jedevc commented on Mar 28, 2024

    @jedevc
    Contributor

    I think this is expected - suppose the following module structure:

    • Module A starts (running a container)
    • Module A calls a function in Module B
    • Module B start (running a container)
    • Module B calls dag.Container() (running a container)
      • This hangs forever! There are already 2 containers running in parallel, so no more can be scheduled.

    I think with modules, this effectively means that max-parallelism is pretty much just completely broken - it just fits very badly with the idea of nested containers.

    Not sure what the right fix is here:

    • Don't use max-parallelism (generally, my preference, you should enforce max usage using different mechanisms instead, since a single job-step could use anywhere from 0% to 100% of available resources - they're not just replaceable)
    • When using a nested step, don't have this "consume a resource" (this prevents deadlocks, but isn't great, since there's now more containers running than the user asked for)

    I don't think there's a clear way forwards here, but to me this kind of highlights that we need a better way of constraining resources - max-parallelism is just really not fit for the shape that pipelines tend to take these days. Maybe we should provide some cgroup config options instead (if the end desire is to constrain CPU usage/etc).

  5. added this to the v0.12.0 milestone on May 15, 2024
  6. jedevc commented on May 15, 2024

    @jedevc
    Contributor

    Adding this to the v0.12.0 milestone since by that release we should probably either:

    • Remove this flag
    • Ensure that nested execs don't count towards max-parallelism
      As is, with modules, this flag can cause huge performance issues, so should be avoided.
  7. jedevc commented on May 16, 2024

    @jedevc
    Contributor

    x-linking to #6465 as well.

  8. removed
    kind/bug
    on May 31, 2024
  9. jedevc commented on Jul 11, 2024

    @jedevc
    Contributor

    Bleh, shifting this one out of the milestone - I think we've got some rough consensus to take option 2 in #6894 (comment), which is actually a backwards compatible change, so we can work on this at another point.

  10. modified the milestones: v0.12.0, next on Jul 11, 2024
  11. locked and limited conversation to collaborators on Mar 24, 2026
  12. converted this issue into a discussion #12340 on Mar 24, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions