Skip to content

deadlock when two tasks are concurrently waiting for an unresolved ActorFuture #5708

@graingert

Description

@graingert

What happened:
deadlock when two tasks are concurrently waiting for an unresolved ActorFuture

What you expected to happen:
both tasks should complete at the same time

Minimal Complete Verifiable Example:

import asyncio

import distributed


class Actor:
    def action(self):
        return "acted"


async def amain():
    async with distributed.Client(
        processes=True, security=True, asynchronous=True
    ) as client:
        actor = await client.submit(Actor, actor=True)
        inc_fut = actor.action()

        async def wait(v):
            return await v

        assert await asyncio.gather(wait(inc_fut), wait(inc_fut)) == ["acted", "acted"]


if __name__ == "__main__":
    asyncio.run(amain())

Anything else we need to know?:

Environment:

  • Dask version:
  • Python version:
  • Operating System:
  • Install method (conda, pip, source):
Cluster Dump State:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions