Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make bgpmon autorestart enabled by supervisord #5460

Merged
merged 1 commit into from
Sep 25, 2020
Merged

make bgpmon autorestart enabled by supervisord #5460

merged 1 commit into from
Sep 25, 2020

Conversation

gechiang
Copy link
Collaborator

This PR is to address the suggested change in review of (#5426 (comment)) to make bgpmon autorestart by supervisord.

- Why I did it

To address the autorestart capability of bgpmon in master branch which is configured differently from 201911 branch.

- How I did it

Set autorestart=true in the supervisord config file supervisord/supervisord.conf.j2

- How to verify it

Killed bgpmon and validate that it gets auto restarted correctly and that the stateDB info is correct after bgpmon restarted.

admin@sonic:~$ docker exec -it bgp /bin/bash
root@sonic:/# ps -aef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 17:28 pts/0    00:00:04 /usr/bin/python2 /usr/bin/supervisord
root        22     1  0 17:28 pts/0    00:00:00 python /usr/bin/supervisor-proc-exit-listener --container-name bgp
root        26     1  0 17:28 pts/0    00:00:00 /usr/sbin/rsyslogd -n -iNONE
frr         30     1  5 17:28 pts/0    00:00:39 /usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm -M snmp
frr         31     1  0 17:28 pts/0    00:00:00 /usr/lib/frr/staticd -A 127.0.0.1
frr         32     1  3 17:28 pts/0    00:00:24 /usr/lib/frr/bgpd -A 127.0.0.1 -M snmp
root        41     1  0 17:28 pts/0    00:00:05 /usr/bin/python /usr/local/bin/bgpcfgd
root        42     1  0 17:28 pts/0    00:00:00 /usr/bin/python /usr/local/bin/bgpmon
root        43     1  1 17:28 pts/0    00:00:11 fpmsyncd
root       228     0  1 17:40 pts/1    00:00:00 /bin/bash
root       233   228  0 17:40 pts/1    00:00:00 ps -aef
root@sonic:/# kill -9 42
root@sonic:/# ps -aef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 17:28 pts/0    00:00:04 /usr/bin/python2 /usr/bin/supervisord
root        22     1  0 17:28 pts/0    00:00:00 python /usr/bin/supervisor-proc-exit-listener --container-name bgp
root        26     1  0 17:28 pts/0    00:00:00 /usr/sbin/rsyslogd -n -iNONE
frr         30     1  5 17:28 pts/0    00:00:39 /usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm -M snmp
frr         31     1  0 17:28 pts/0    00:00:00 /usr/lib/frr/staticd -A 127.0.0.1
frr         32     1  3 17:28 pts/0    00:00:24 /usr/lib/frr/bgpd -A 127.0.0.1 -M snmp
root        41     1  0 17:28 pts/0    00:00:05 /usr/bin/python /usr/local/bin/bgpcfgd
root        43     1  1 17:28 pts/0    00:00:11 fpmsyncd
root       228     0  0 17:40 pts/1    00:00:00 /bin/bash
root       234     1 33 17:40 pts/0    00:00:00 /usr/bin/python /usr/local/bin/bgpmon
root       236   228  0 17:40 pts/1    00:00:00 ps -aef
root@sonic:/# kill -9 234
root@sonic:/# ps -aef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 17:28 pts/0    00:00:04 /usr/bin/python2 /usr/bin/supervisord
root        22     1  0 17:28 pts/0    00:00:00 python /usr/bin/supervisor-proc-exit-listener --container-name bgp
root        26     1  0 17:28 pts/0    00:00:00 /usr/sbin/rsyslogd -n -iNONE
frr         30     1  5 17:28 pts/0    00:00:39 /usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm -M snmp
frr         31     1  0 17:28 pts/0    00:00:00 /usr/lib/frr/staticd -A 127.0.0.1
frr         32     1  3 17:28 pts/0    00:00:24 /usr/lib/frr/bgpd -A 127.0.0.1 -M snmp
root        41     1  0 17:28 pts/0    00:00:05 /usr/bin/python /usr/local/bin/bgpcfgd
root        43     1  1 17:28 pts/0    00:00:11 fpmsyncd
root       228     0  0 17:40 pts/1    00:00:00 /bin/bash
root       237     1 15 17:40 pts/0    00:00:00 /usr/bin/python /usr/local/bin/bgpmon
root       239   228  0 17:40 pts/1    00:00:00 ps -aef
root@sonic:/# exit
exit
admin@sonic:~$ show logging
...
Sep 24 17:40:26.076067 sonic INFO bgp#supervisord 2020-09-24 17:40:17,965 INFO exited: bgpmon (terminated by SIGKILL; not expected)
Sep 24 17:40:26.076067 sonic INFO bgp#supervisord 2020-09-24 17:40:18,980 INFO spawned: 'bgpmon' with pid 234
Sep 24 17:40:26.076067 sonic INFO bgp#supervisord 2020-09-24 17:40:18,992 INFO success: bgpmon entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
Sep 24 17:40:36.085493 sonic INFO bgp#supervisord 2020-09-24 17:40:28,320 INFO exited: bgpmon (terminated by SIGKILL; not expected)
Sep 24 17:40:36.085493 sonic INFO bgp#supervisord 2020-09-24 17:40:29,331 INFO spawned: 'bgpmon' with pid 237
Sep 24 17:40:36.085493 sonic INFO bgp#supervisord 2020-09-24 17:40:29,363 INFO success: bgpmon entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
...
admin@sonic:~$ redis-cli -n 6
127.0.0.1:6379[6]> keys "NEIGH*"
(empty array)
127.0.0.1:6379[6]> keys "NEIGH*"
 1) "NEIGH_STATE_TABLE|fc00::3a"
 2) "NEIGH_STATE_TABLE|fc00::1a"
 3) "NEIGH_STATE_TABLE|fc00::46"
 4) "NEIGH_STATE_TABLE|fc00::76"
 5) "NEIGH_STATE_TABLE|10.0.0.39"
 6) "NEIGH_STATE_TABLE|fc00::2"
 7) "NEIGH_STATE_TABLE|10.0.0.49"
 8) "NEIGH_STATE_TABLE|fc00::56"
 9) "NEIGH_STATE_TABLE|fc00::22"
10) "NEIGH_STATE_TABLE|10.0.0.45"
11) "NEIGH_STATE_TABLE|10.0.0.61"
12) "NEIGH_STATE_TABLE|10.0.0.13"
13) "NEIGH_STATE_TABLE|10.0.0.35"
14) "NEIGH_STATE_TABLE|fc00::72"
15) "NEIGH_STATE_TABLE|fc00::4a"
16) "NEIGH_STATE_TABLE|10.0.0.29"
17) "NEIGH_STATE_TABLE|fc00::6e"
18) "NEIGH_STATE_TABLE|fc00::a"
19) "NEIGH_STATE_TABLE|10.0.0.55"
20) "NEIGH_STATE_TABLE|fc00::5e"
21) "NEIGH_STATE_TABLE|10.0.0.43"
22) "NEIGH_STATE_TABLE|10.0.0.1"
23) "NEIGH_STATE_TABLE|fc00::7e"
24) "NEIGH_STATE_TABLE|10.0.0.21"
25) "NEIGH_STATE_TABLE|10.0.0.47"
26) "NEIGH_STATE_TABLE|10.0.0.53"
27) "NEIGH_STATE_TABLE|fc00::42"
28) "NEIGH_STATE_TABLE|fc00::7a"
29) "NEIGH_STATE_TABLE|fc00::6a"
30) "NEIGH_STATE_TABLE|10.0.0.57"
31) "NEIGH_STATE_TABLE|10.0.0.37"
32) "NEIGH_STATE_TABLE|fc00::32"
33) "NEIGH_STATE_TABLE|fc00::4e"
34) "NEIGH_STATE_TABLE|10.0.0.9"
35) "NEIGH_STATE_TABLE|fc00::66"
36) "NEIGH_STATE_TABLE|fc00::52"
37) "NEIGH_STATE_TABLE|fc00::5a"
38) "NEIGH_STATE_TABLE|10.0.0.63"
39) "NEIGH_STATE_TABLE|10.0.0.51"
40) "NEIGH_STATE_TABLE|10.0.0.5"
41) "NEIGH_STATE_TABLE|fc00::12"
42) "NEIGH_STATE_TABLE|10.0.0.41"
43) "NEIGH_STATE_TABLE|10.0.0.59"
44) "NEIGH_STATE_TABLE|10.0.0.17"
45) "NEIGH_STATE_TABLE|fc00::2a"
46) "NEIGH_STATE_TABLE|10.0.0.33"
47) "NEIGH_STATE_TABLE|fc00::62"
48) "NEIGH_STATE_TABLE|10.0.0.25"
127.0.0.1:6379[6]> hgetall  "NEIGH_STATE_TABLE|10.0.0.55"
1) "state"
2) "Active"
127.0.0.1:6379[6]>

@gechiang
Copy link
Collaborator Author

retest vsimage please

@gechiang gechiang merged commit 43a8368 into sonic-net:master Sep 25, 2020
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants