Skip to content

wait_for_idle() inside an actor never returns: a handler's own step stays counted #3463

Closed

Description

@nicolas-maman

wait_for_idle() called inside an actor, in a message handler or in a receive timeout's after arm, does not return: it waits for every actor, the calling one too, and the calling actor's step cannot end while it waits.

  • In a handler it hangs forever. The handler's own message counts as sent and not yet handled until the step returns (count_pending_messages, sent > processed), so the wait's quiet window never opens, and the pending path has no bound.
  • In an arm it waits for the arm's own step (wait_for_idle() returns while a receive timeout's arm still runs #3443 counts a firing step until its arm returns). A per-thread discount of the arms a thread is inside (on the batch branch) leaves out only its own arm: two arms that wait at once count each other and poll until the 100 s bound, and an arm's wait also waits for the actors of its own core, which cannot step while the arm blocks it (a message pending to one of them hangs it forever).

Found by a review of PR #3334. No program or test in the tree calls it inside an actor.

Expected: a defined outcome, on both schedulers. The wait cannot complete from inside a step, so it should refuse there, as a panic of the actor's code: the step barrier ends the actor with a reason that says what to do (call it from main or a thread outside the actors), its watchers are told, and the rest of the program goes on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions