Executor callbacks are no longer in a predictable order
维护者通常 1 天内回复
@wjwwood 已经在做这个了。
开始于 2024年5月16日。
评估
这个 Issue 还没有评估数据。
描述
Bug report
Required Info:
- Operating System:
- Ubuntu 20.04
- Installation type:
- Source
- Version or commit hash:
- DDS implementation:
- Fast-RTPS
- Client library (if applicable):
- rclcpp
Steps to reproduce issue
- Build the https://github.com/boschresearch/ros2_response_time_analysis project against ROS2 Jazzy (note that some minimal changes are required).
- Observe that the results of running the test show that the callbacks are executed in an arbitrary order as compared to the previous ordering which was with respect to the order in which the subscriptions/services were added to the node.
Expected behavior
With ROS2 Eloquent through Iron, the callbacks all executed in the following order, where the ordering was defined by the order in which the subscriptions/services were added to the node.
Actual behavior
With ROS2 Jazzy, the ordering is now arbitrary and not related to the order in which messages were received or the order in which subscriptions were added to the node. The execution order of timers also appears to be affected.
NOTE: While the low, medium, and high subscriptions are processed in the same order that they are transmitted, I believe this to be a fluke as the service and timer callbacks are not processed in the order they were registered or sent. For reference, the callbacks are registered in the following order:
- high
- medium
- low
- srv_high
- srv_medium
- srv_low
- timers (as directed by the test)
And the topics/services are sent in the following order:
- low
- medium
- high
- srv_high
- srv_low
- low
- medium
- high
- srv_high
- srv_low
- srv_medium
- srv_medium
- high
With timers set to expire at 200, 200, 2300, and 2300 milliseconds into the test.
Additional information
I believe this change is a result of #2142 due to the EntityCollection class being based on std::unordered_map where the key is the handle returned by rcl for the timer/subscription/etc. The entities are then added to the wait set in whatever order they are iterated through by the std::unordered_map and thus processed in that order. I haven't had the opportunity to test it, but I believe the ordering could be different from system to system or even run to run as the rcl handle values change.
The default AllocatorMemoryStrategy used in previous versions of rclcpp utilized std:vector for storing rcl handles, which maintained the order in which they were added to the node.
- 主要语言
- C++
- 星标
- 829
- 派生
- 587
- 平均合并
- 4 天 6 小时
- 30 天内合并 PR
- 30
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ros2/rclcpp 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
Memory grows per callback group created and destroyed on long lived nodes可能已有人在做 @jwallace42 于 1 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 28/100
ros2/rclcpp#3428 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
removing and immediately re-adding a node to the EventsCBGExecutor leaves its entities unregistered可能已有人在做 @skyegalaxy 于 10 天前认领。 未关闭bug
维护者通常 1 天内回复
-
[Humble] Removing a node with more than one auto-added callback group leaves a dangling guard condition in the executor可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 1/5 1-3 小时 新手友好度 82/100
EchoTools/nevr-runtime#2912 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
category:port-update
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
bug-unconfirmed
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复
-
libc++
难度 1/5 1 小时以内 新手友好度 88/100
llvm/llvm-project#246508 ·
维护者通常 1 天内回复