watchfrr,tools: add --collect-core to core dump unresponsive daemon - #21051
Conversation
1a9ded2 to
6b30829
Compare
Greptile SummaryThis PR adds an optional Key changes:
One notable unresolved side effect: because Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant WF as watchfrr
participant SH as frrcommon.sh (daemon_stop)
participant D as FRR daemon
WF->>WF: detect unresponsive daemon
WF->>WF: setenv FRR_COLLECT_CORE, WATCHFRR_RESTART_TIMEOUT
WF->>SH: run stop script (restart_kill timer = restart_timeout)
SH->>SH: compute phase_sec = (restart_timeout - 2) / 2 [if collect-core]
SH->>D: SIGINT
SH->>SH: wait up to phase_sec seconds
alt daemon still alive AND FRR_COLLECT_CORE=1
SH->>D: SIGABRT (triggers core dump)
SH->>SH: wait up to phase_sec seconds
end
alt daemon still alive
SH->>D: SIGKILL
SH->>SH: wait up to 1 second
end
SH-->>WF: script exits (within restart_timeout window)
|
789ad56 to
92e7d33
Compare
|
@greptile review |
92e7d33 to
b0a5e79
Compare
|
@greptile review |
b0a5e79 to
cdce2da
Compare
|
ci:rerun |
cdce2da to
8b8a4fb
Compare
|
ci:rerun |
8b8a4fb to
cfad111
Compare
|
@greptile review |
choppsv1
left a comment
There was a problem hiding this comment.
This feels a little over-engineered, will come back with suggested simplification.
|
I think the --collect-core to But this change seems overly complex, it creates and environment variable that messes with the timer restart values in some non-simple ways, it still SIGINTs the PID, and only when that times out as well (i.e., in addition to missing a heartbeats) it then does a SIGABRT to collect the core when the env variable is set. This seems too complex. I think we should just add a direct This is also debugging the direct issue. The current method in the PR is actually debugging why SIGINT didn't work rather than what it's doing to miss the hearbeat, so this could be getting a core for a secondary problem rather than the primary one. |
When a daemon does not respond to the VTY ping, and watchfrr_options="--collect-core" is configured, watchfrr is going to send SIGABRT to the unresponsive daemon to dump the core. Aim is to improve debugability of such stuck daemons. Enable with watchfrr_options="--collect-core" in /etc/frr/daemons file. Signed-off-by: Nishant <nshntsharma86@gmail.com>
cfad111 to
43fa519
Compare
|
@choppsv1 Thank you for the review, I have updated the PR to be more specific and simple as per your suggestion. I still see some scope of improvement in frrcommon.sh.in which I feel I can address in a seperate PR to keep this PR specific and simple. for example :
|
When a daemon does not respond to the VTY ping, and watchfrr_options="--collect-core" is configured, watchfrr is going to send SIGABRT to the unresponsive daemon to dump the core.
Aim is to improve debugability of such stuck daemons.
Enable with watchfrr_options="--collect-core" in daemons.