Skip to content

Commit

Permalink
Fix docker auto restart issue (#21377)
Browse files Browse the repository at this point in the history
Why I did it
if critical process crashes or killed, bmp docker container will not be auto-restarted.

How I did it
/usr/bin/supervisor-proc-exit-listener takes in charge of critical process monitor and event publish, thus it should be autorestar-ted in any case, otherwise there might be issue if supervisor-proc-exit-listener crashes, or in some test cases like
"docker exec bmp kill -SIGKILL -1" critical processes may not work correctly in some race condition (depends on whether supervisor-proc-exit-listener is the last one to be killed)

When a container receives the SIGKILL signal to terminate its processes, the order in which the processes are actually terminated can depend on the scheduling and resource availability within the container.

If supervisor-proc-exit-listener is killed first before critical process, container auto restart will not be launched as expected.
  • Loading branch information
FengPan-Frank authored Jan 14, 2025
1 parent bb90401 commit 7a21cab
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dockers/docker-sonic-bmp/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buffer_size=1024
command=/usr/bin/supervisor-proc-exit-listener --container-name bmp
events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING
autostart=true
autorestart=false
autorestart=unexpected
buffer_size=1024

[program:rsyslogd]
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-sonic-gnmi/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buffer_size=1024
command=/usr/bin/supervisor-proc-exit-listener --container-name gnmi
events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING
autostart=true
autorestart=false
autorestart=unexpected
buffer_size=1024

[program:rsyslogd]
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-sonic-restapi/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buffer_size=1024
command=/usr/bin/supervisor-proc-exit-listener --container-name restapi
events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING
autostart=true
autorestart=false
autorestart=unexpected
buffer_size=1024

[program:rsyslogd]
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-sonic-telemetry/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buffer_size=1024
command=/usr/bin/supervisor-proc-exit-listener --container-name telemetry
events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING
autostart=true
autorestart=false
autorestart=unexpected
buffer_size=1024

[program:rsyslogd]
Expand Down

0 comments on commit 7a21cab

Please sign in to comment.