Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

nd_watcher#20103

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ktsaou wants to merge4 commits intonetdata:master
base:master
Choose a base branch
Loading
fromktsaou:feature/parent-process-monitoring

Conversation

ktsaou
Copy link
Member

@ktsaouktsaou commentedApr 9, 2025
edited
Loading

Add parent process monitoring to update status file on hard kills.

This commit adds a parent-child process architecture to improve status file accuracy when Netdata is terminated abruptly. The implementation:

  1. Creates a parent process at startup that monitors the Netdata child process
  2. Parent process changes its name to "nd_watcher" to avoid being killed by pkill
  3. When the child process is killed abruptly, the parent updates the status file
  4. Adds EXIT_REASON_HARD_KILLED flag for processes killed without a recognizable signal
  5. Forwards termination signals from parent to child
  6. Centralizes status file loading with daemon_status_file_load_latest()

With this, the process tree looks like this:

 535187 pts/4    Ss+    0:00  |       \_ nd_watcher 535204 pts/4    Sl+   12:20  |           \_ /usr/bin/netdata -D 535206 pts/4    S+     0:00  |               \_ spawn-plugins       535820 pts/4    S+     0:00  |                   \_ bash /usr/libexec/netdata/plugins.d/tc-qos-helper.sh 1 535822 pts/4    Sl+    0:05  |                   \_ /usr/libexec/netdata/plugins.d/go.d.plugin 1 536149 pts/4    S+     0:46  |                   |   \_ /bin/intel_gpu_top -J -s 900 535862 pts/4    Sl+    0:01  |                   \_ /usr/libexec/netdata/plugins.d/systemd-journal.plugin 1 535871 pts/4    S+     0:10  |                   \_ /usr/libexec/netdata/plugins.d/slabinfo.plugin 1 535894 pts/4    Sl+    0:00  |                   \_ /usr/libexec/netdata/plugins.d/network-viewer.plugin 1 535968 pts/4    S+     0:00  |                   |   \_ spawn-setns                                            535904 pts/4    S+     0:00  |                   \_ /usr/libexec/netdata/plugins.d/perf.plugin 1 all 535911 pts/4    Sl+    0:48  |                   \_ /usr/libexec/netdata/plugins.d/apps.plugin 1 535922 pts/4    S+     0:01  |                   \_ /usr/libexec/netdata/plugins.d/cups.plugin 1 535935 pts/4    Sl+    0:05  |                   \_ /usr/libexec/netdata/plugins.d/debugfs.plugin 1 535954 pts/4    S+     0:00  |                   \_ /usr/libexec/netdata/plugins.d/nfacct.plugin 1

This commit adds a parent-child process architecture to improve status file accuracy when Netdata is terminated abruptly. The implementation:1. Creates a parent process at startup that monitors the Netdata child process2. Parent process changes its name to "nd_watcher" to avoid being killed by pkill3. When the child process is killed abruptly, the parent updates the status file4. Adds EXIT_REASON_HARD_KILLED flag for processes killed without a recognizable signal5. Forwards termination signals from parent to child6. Centralizes status file loading with daemon_status_file_load_latest()
@ktsaouktsaouforce-pushed thefeature/parent-process-monitoring branch from7cf39eb toeb34190CompareApril 9, 2025 19:11
@ktsaouktsaou requested a review froma team as acode ownerApril 9, 2025 19:11
@github-actionsgithub-actionsbot added the area/buildBuild system (autotools and cmake). labelApr 9, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@thiagoftsmthiagoftsmAwaiting requested review from thiagoftsmthiagoftsm is a code owner

@vkalintirisvkalintirisAwaiting requested review from vkalintirisvkalintiris is a code owner

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
area/buildBuild system (autotools and cmake).area/daemon
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@ktsaou

[8]ページ先頭

©2009-2025 Movatter.jp