Issue with RCLCPP THROTTLE logging in the plugin based approach
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- cpp
调研方向
首先阅读 rcutils/resource/logging_macros.h.em,尤其是报告中引用的 RCUTILS_LOG_CONDITION_THROTTLE_BEFORE 逻辑,并跟踪 RCLCPP_XXX_THROTTLE 如何到达该逻辑。使用不同 logger 名称的多个 plugin 实例验证其行为;完成的标准是每个 logger 都具有独立的 throttle 间隔。payload 未指定测试文件。
由索引模型根据 Issue 内容生成。
描述
Bug report
Hello!
I've a plugin that I use it to perform some computations and return and this plugin runs at a higher frequency, and then to reduce spamming, I've changed the original logging with THROTTLE. It works fine as long as only one plugin is loaded in my system. If I load multiple plugins of the same type, it doesn't print the THROTTLE log of other plugins but only the first one even though they have different loggers with different names.
I believe this is caused by the fact that the RCLCPP_XXX_THROTTLE internally uses the following macro RCUTILS_LOG_CONDITION_THROTTLE_BEFORE and this is using some static variables inside. The condition for logging (i.e., if a certain duration has passed since the last log message) will remain the same, as this is determined by the code in the macro, not by the logger. The __rcutils_logging_last_logged variable, which keeps track of the last time a log message was outputted, is static and unique to each line where the macro is used. Therefore, even if you change the logger, the duration-based condition for logging will still be unique to each line.
I think it makes sense to also consider the logger type to be same or not in the same check as well. In my current implementation, the logger name is changed depending on the name of the plugin, but not the type. This way it is unique for every plugin instance.
Required Info:
- Operating System:
- Ubuntu 22.04 and 24.04
- Installation type:
- Binaries
Expected behavior
Different loggers should have different throttles even if they are in the same line as the plugin
Actual behavior
Different loggers are throttles as one and the information is lost inside the plugin
Is there a workaround or a better approach in this case?
- 主要语言
- 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
-
arch-based bug niri
难度 2/5 1-3 小时 新手友好度 68/100
noctalia-dev/noctalia#5552 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1-3 小时 新手友好度 82/100
EchoTools/nevr-runtime#2912 ·
维护者通常 1 天内回复
-
area/docdb kind/failing-test priority/medium status/awaiting-triage
难度 2/5 1-3 小时 新手友好度 82/100
yugabyte/yugabyte-db#39462 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
meshtastic/firmware#12519 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复