fix: avoid double restart of pmlogger on config changes - #92
Conversation
The pmlogger timers and control.d tasks notified a handler to restart pmlogger, but those same changes already set __pcp_restart_pmlogger and triggered a restart in the main service task. On first playbook run this could restart pmlogger twice in quick succession, causing systemd to fail the second start on Type=notify services. Drop the redundant handler notifications and the Restart pmlogger handler; rely on the existing restart task, consistent with pmie.
📝 WalkthroughWalkthroughThis change removes the pmlogger handler and consolidates restart logic into the task file. The handler removal eliminates the separate notification target, while task refactoring introduces targeted-host and single-control templating with conditional gates and a computed restart flag that unifies restart decisions based on detected changes. Changespmlogger Restart Logic Refactoring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@richm may I ask you for review please? This is sort of a race condition I randomly observe during down stream testing on RHEL. |
The pmlogger timers and control.d tasks notified a handler to restart pmlogger, but those same changes already set __pcp_restart_pmlogger and triggered a restart in the main service task. On first playbook run this could restart pmlogger twice in quick succession, causing systemd to fail the second start on Type=notify services.
Drop the redundant handler notifications and the Restart pmlogger handler; rely on the existing restart task, consistent with pmie.
Resolves: RHEL-182971