Repository navigation
cephadm: report intentionally stopped daemons as stopped - #69283
Conversation
847fbcf to
9ad3983
Compare
|
I also reproduced the same symptom with mgr (status=143, systemd failed state, CEPHADM_FAILED_DAEMON). Since mgr is Ceph-owned, I kept this change scoped to node-exporter and will investigate the mgr behavior separately. |
|
To elaborate a bit on my earlier comment:
|
Thanks for the clarification. I reworked this to follow the container path you suggested. The success exit status is now carried by This removes the separate daemon-form interface and keeps the daemon-specific knowledge within the daemon/container implementation. |
706097b to
24cc69c
Compare
|
While validating the node-exporter fix, I also investigated the mgr portion of the original issue. ReproductionStopping a standby mgr daemon: results in: Systemd reports: I reproduced this on:
and then stopping the former active mgr. Both cases produced the same result ( Comparison with other daemons
Code investigation
which ultimately calls: suggesting that mgr is intended to exit cleanly on SIGTERM. However, after reproducing the issue and inspecting the journal: I could not find the log message emitted by and the observed runtime behavior remains: ConclusionThe mgr behavior appears to be a separate issue from node-exporter. The node-exporter fix in this PR is validated and behaves as expected (stopped daemon, HEALTH_OK, systemd accepts exit code 143 via SuccessExitStatus). For mgr, the current evidence suggests that the SIGTERM handler is either not being invoked or the process is terminating before the handler can convert the exit status to 0. |
phlogistonjohn
left a comment
There was a problem hiding this comment.
Thank you very much for incorporating that feedback. Since the earlier version is an intermediate change can I impose on you to please squash the two patches together so we have a cleaner overall history? Feel free to ask for help if you haven't done this before.
node-exporter exits with status 143 when terminated via SIGTERM. Systemd treats this as a failure by default, causing cephadm to report an intentionally stopped daemon as being in an error state. Allow daemon forms to provide daemon-specific success exit status codes and generate a corresponding systemd SuccessExitStatus drop-in when required. For node-exporter, configure exit status 143 as successful so intentional stops are reported as stopped rather than failed. Fixes: https://tracker.ceph.com/issues/68863 Signed-off-by: Shubha Jain <[email protected]>
24cc69c to
391383d
Compare
Thanks for the review. I've squashed the implementation and refactor commits into a single commit and force-pushed the updated branch. |
|
@Shubhaj1810 can you plz open a separate tracker for the mgr not existing correctly on SIGTERM? |
Sure, I'll open a separate tracker for the mgr SIGTERM handling and keep this PR focused on the node-exporter issue. |
|
jenkins test make check |
|
Teuthology run was successful. Failing Test cases are not related to this PR: |
Summary
node-exporter exits with status code 143 when stopped via SIGTERM. Systemd interprets this as a failed service, causing cephadm to mark the daemon as
errorinstead ofstopped.This change adds a node-exporter-specific systemd drop-in that sets:
SuccessExitStatus=143
so that intentional stops are treated as successful shutdowns.
Validation
Before:
ceph orch daemon stop node-exporter.<host>errorCEPHADM_FAILED_DAEMONAfter:
ceph orch daemon stop node-exporter.<host>stoppedinactive (dead)with exit code 143HEALTH_OKTesting
Signed-off-by: Shubha Jain [[email protected]]
Fixes: https://tracker.ceph.com/issues/68863
Resolves: IBMCEPH-8866
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.