Reuse bond heartbeat watchdog timer - #116
Open
mini-1235 wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
Could you also take a look at this one? It is related to ros-navigation/navigation2#6061, and you are more familiar with this part of the code than I am. |
SteveMacenski
approved these changes
Sep 1, 2026
|
|
||
| void Bond::heartbeatTimerReset() | ||
| { | ||
| if (heartbeat_timer_) { |
Member
There was a problem hiding this comment.
This seems to work I think. heartbeat_timeout_ can change using setHeartbeatTimeout but since it doesn't change when started_, its OK as this only occurs after its started.
Member
There was a problem hiding this comment.
Just adding the comment for a future reviewer that I'm sure will want to track down the same thing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This came up while I was doing some lifecycle manager performance work in Nav2. In summary, this PR includes the following changes:
Bond::heartbeatTimerReset()now reuses the existing heartbeat watchdog timer instead of destroying and recreating it on every heartbeat. The first heartbeat still creates the timer, while subsequent heartbeats callTimerBase::reset()to renew the deadline. This preserves the intended watchdog behavior without changing the heartbeat frequency or timeout duration. In my 2-minute performance test, this gives a small improvement of about 2%, but since this is related toheartbeat_timeout_, I think it is still worth optimizing.This PR also narrows the included
rclcppheaders to help reduce build time, and updates the minimum CMake version.Assisted by Codex 5.6 Sol