Commit d64e123
fix: Prevent panic on context cancellation during agent shutdown
The leader election callback in the agent was previously panicking if the agent encountered an error, including context.Canceled which is expected during graceful shutdown.
This commit modifies the callback to check if the error is context.Canceled. If so, it logs an informational message and exits gracefully. Other unexpected errors will still cause a panic.
Signed-off-by: davidepasquero <davide.pasquero@gmail.com>1 parent b2be0d8 commit d64e123
1 file changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
46 | 53 | | |
| 54 | + | |
| 55 | + | |
47 | 56 | | |
| 57 | + | |
48 | 58 | | |
49 | 59 | | |
50 | 60 | | |
| |||
0 commit comments