Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent continuous heartbeats #395

Merged
merged 2 commits into from
Jul 27, 2023
Merged

Prevent continuous heartbeats #395

merged 2 commits into from
Jul 27, 2023

Conversation

engelmi
Copy link
Member

@engelmi engelmi commented Jul 26, 2023

This PR

disables heartbeat for intervals smaller or equal to 0

If the heartbeat interval is set to 0, this event gets fired continuously, consuming a lot of CPU (on my machine ~80% for hirte-agent and ~60% for hirte). To prevent this don't register any heartbeat for interval values smaller than or equal to 0. Smaller values also disable the heartbeat, so not registering at all has the same result.

fully initializes the serveraddr struct

Running hirte with valgrind, it complains about servaddr.sin6_flowinfo and sin6_scope_id not to be initialized. Setting these values to 0 should keep the current behavior and still initialize it.

engelmi added 2 commits July 26, 2023 14:21
If the heartbeat interval is set to 0, this event gets
fired continuously, consuming a lot of CPU. To prevent
this don't register any heartbeat for interval values
smaller than or equal to 0. Smaller values also disable
the heartbeat, so not registering at all has the same
result

Signed-off-by: Michael Engel <[email protected]>
@engelmi engelmi force-pushed the prevent-continuous-heartbeats branch from a1d9260 to 30cf543 Compare July 26, 2023 12:21
Copy link
Member

@mwperina mwperina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@engelmi engelmi merged commit 2db0483 into main Jul 27, 2023
@engelmi engelmi deleted the prevent-continuous-heartbeats branch July 27, 2023 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants