FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix vnode take over crash by stelfrag · Pull Request #22417 · netdata/netdata · GitHub

Fix vnode take over crash - #22417

Merged
stelfrag merged 1 commit into
netdata:masterfrom
stelfrag:set-receiver-activate-idempotent
May 6, 2026
Merged

Fix vnode take over crash#22417
stelfrag merged 1 commit into
netdata:masterfrom
stelfrag:set-receiver-activate-idempotent

Conversation

stelfrag commented May 4, 2026
edited by cubic-dev-ai Bot
Loading

Copy link
Copy Markdown
Collaborator
Summary

rrdhost_set_receiver() called object_state_activate() on host->state_id, which fatals if the state is already activated.

A vnode created via HOST_DEFINE_END activates state_id; when the vnode goes stale, pluginsd_host clears RRDHOST_OPTION_VIRTUAL_HOST but leaves state_id activated.

A subsequent streaming connection for the same machine_guid bypasses the rrdhost_is_virtual() reject, reaches set_receiver, and crashes on the second activate.


Summary by cubic

Prevent crash when a stale vnode reconnects for the same machine_guid by making receiver activation idempotent. rrdhost_set_receiver() now calls object_state_activate_if_not_activated(&host->state_id) to avoid fatal errors when state_id is already active.

Written for commit 3a20af2. Summary will update on new commits.

…ted() so it no longer fatals when state_id was left activated by a stale vnode (HOST_DEFINE_END activates state_id
stelfrag marked this pull request as ready for review May 4, 2026 18:14
stelfrag requested a review from thiagoftsm as a code owner May 4, 2026 18:14
Copilot AI review requested due to automatic review settings May 4, 2026 18:14
stelfrag marked this pull request as draft May 4, 2026 18:14

sonarqubecloud Bot commented May 4, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR fixes a crash when a stale virtual node reconnects and rrdhost_set_receiver() attempts to activate an already-active state_id.

Changes:

  • Make receiver state activation idempotent in rrdhost_set_receiver().
  • Replace the fatal-on-repeat activation call with a conditional activation helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

stelfrag changed the title Fix vnode take offer crash Fix vnode take over crash May 4, 2026
stelfrag marked this pull request as ready for review May 5, 2026 05:56

thiagoftsm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

No issues found with local stream during runtime. LGTM!

stelfrag merged commit 4c11048 into netdata:master May 6, 2026
283 of 287 checks passed
stelfrag deleted the set-receiver-activate-idempotent branch May 6, 2026 18:24
stelfrag mentioned this pull request Jun 22, 2026
Ferroin pushed a commit that referenced this pull request Jul 15, 2026
Switch rrdhost_set_receiver() to object_state_activate_if_not_activated() so it no longer fatals when state_id was left activated by a stale vnode (HOST_DEFINE_END activates state_id

(cherry picked from commit 4c11048)
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL