You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor launch service run_async loop to wait on futures and queued events (ros2#449)
Fixesros2/launch_ros#169
Otherwise, it's possible to get into a hung state where we wait for an event,
even though there are no more events. This is because the check for an "idle"
state evaluates to "True" as we wait for some futures to complete.
By waiting for futures and events concurrently, we can avoid this problem.
Further, we don't have to wait for an event if there's nothing in the queue.
Signed-off-by: Jacob Perron <[email protected]>
* Wait until one event is processed or nothing done (timeout)
Signed-off-by: Jacob Perron <[email protected]>
* Fix bugs
Always create a task to wait on and cancel it if there is a timeout.
Signed-off-by: Jacob Perron <[email protected]>
* Avoid canceling an event mid-processing
Signed-off-by: Jacob Perron <[email protected]>
* minor refactor
Signed-off-by: Jacob Perron <[email protected]>
* Guard against leaving a task pending
Signed-off-by: Jacob Perron <[email protected]>
* Further refactoring
We don't need to have an inner loop or timeout when waiting on futures.
Signed-off-by: Jacob Perron <[email protected]>
* Only wait on futures if there are no events in the queue
This prevents spurious wake-ups when we're waiting for an event to finish processing.
Signed-off-by: Jacob Perron <[email protected]>
0 commit comments