Skip to content

IPC causes spurious awakes of the executor #2

Description

@alsora

I'm investigating spurious awakes in both the standard and this executor.
See ros2/rclcpp#1021 for the standard executor

The problem mentioned in the ticket above does not appear in the static executor when I run that dummy executable with only 1 timer.
However, if I run a system made of 2 nodes (1 pub and 1 sub) in the same executor with IPC on, I see the exact same pattern.

I think that the root cause is how the static executor handles the waitable objects:
in each "iteration" of the static executor:

  • timer makes the publisher to publish a message. It's intra-process only, so the message is pushed into the subscription queue and the condition variable is triggered.
  • the executor checks waitable objects only through the is_ready() condition, that in this case consists in checking if the buffer is not empty. Since a message has just been pushed, the IPC subscription is invoked.
  • the executor goes back to wait
  • the executor wakes up immediately due to the condition variable triggered by the publisher above
  • there is no work to do
  • the executor goes back to wait

@MartinCornelis2 what do you think? I think that this problem with IPC is not present with the standard executor because only 1 item is processed in every iteration and the waitables are managed by the memory strategy.

Activity

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions