-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Adjust functions event loop to propagate exit code #21455
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
base: master
Are you sure you want to change the base?
Conversation
|
@cubic-dev-ai please review this PR |
@stelfrag I've started the AI code review. It'll take a few minutes to complete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 6 files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 6 files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a critical shutdown bug by propagating exit codes from the functions_evloop reader thread to plugin mains, preventing crashes when worker threads call exit() while holding a mutex.
Key changes:
- Added optional
statusparameter tofunctions_evloop_init()for exit code propagation - Replaced direct
exit()calls with atomic status storage in the reader thread - Updated all plugins to use atomic operations when checking the exit flag
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/libnetdata/functions_evloop/functions_evloop.h | Added status parameter to functions_evloop_init() signature |
| src/libnetdata/functions_evloop/functions_evloop.c | Implemented atomic status storage; removed exit() call from reader thread |
| src/collectors/apps.plugin/apps_plugin.c | Tracks exit status, uses atomic exit flag check, and exits with propagated status |
| src/collectors/windows-events.plugin/windows-events.c | Updated function call with NULL status; added atomic exit flag check |
| src/collectors/systemd-units.plugin/plugin_systemd_units.c | Updated function call with NULL status; added atomic exit flag check |
| src/collectors/systemd-journal.plugin/systemd-main.c | Updated function call with NULL status; added atomic exit flag check |
| src/collectors/network-viewer.plugin/network-viewer.c | Updated function call with NULL status; added atomic exit flag check |
| src/collectors/freeipmi.plugin/freeipmi_plugin.c | Updated function call with NULL status parameter |
| src/collectors/ebpf.plugin/ebpf_functions.c | Updated function call with NULL status parameter |
| src/collectors/ebpf.plugin/ebpf.h | Changed ebpf_plugin_stop() to use atomic load operation |
| src/collectors/ebpf.plugin/ebpf.c | Changed exit flag assignment to use atomic store operation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
141a464 to
cf7bb03
Compare
… exit status tracking
…ctions_evloop_init call parameters)
…nt race conditions during shutdown.
…n handling (just for consistency)
…ad-safe shutdown handling and clean up formatting inconsistencies.
cf7bb03 to
11cfd84
Compare
Summary
Summary by cubic
Propagates exit codes from functions_evloop to plugin mains. Fixes shutdown by avoiding exit() in worker threads to prevent crashes when a mutex is held.
Written for commit 11cfd84. Summary will update automatically on new commits.