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

Fix bgp crash after BGP allow list configuration is added #6088

Merged
merged 1 commit into from
Dec 2, 2020

Conversation

wangxin
Copy link
Contributor

@wangxin wangxin commented Dec 2, 2020

This change is to fix the bgp crash issue after BGP allow list configuration is added. If load BGP allow list configuration, the bgp service will crash:

admin@vlab-03:~$ cat /tmp/allow_list.json 
{
  "BGP_ALLOWED_PREFIXES": {
    "DEPLOYMENT_ID|0": {
      "prefixes_v6": [
        "2000:172:16:10::/64"
      ], 
      "prefixes_v4": [
        "172.16.10.0/24"
      ]
    }, 
    "DEPLOYMENT_ID|0|1010:1010": {
      "prefixes_v6": [
        "2000:172:16:30::/64"
      ], 
      "prefixes_v4": [
        "172.16.30.0/24"
      ]
    }
  }
admin@vlab-03:~$ sonic-cfggen -j /tmp/allow_list.json -w
admin@vlab-03:~$ docker ps -a
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS                     PORTS               NAMES
78fd2e87f307        docker-sonic-mgmt-framework:latest   "/usr/local/bin/supe鈥   About an hour ago   Up About an hour                               mgmt-framework
37c0c65a2cc8        docker-sonic-telemetry:latest        "/usr/local/bin/supe鈥   About an hour ago   Up About an hour                               telemetry
9ba16c3d5e43        docker-snmp:latest                   "/usr/local/bin/supe鈥   About an hour ago   Up About an hour                               snmp
3f25676e2c32        docker-router-advertiser:latest      "/usr/bin/docker-ini鈥   About an hour ago   Up About an hour                               radv
5ef7df0e93c7        docker-dhcp-relay:latest             "/usr/bin/docker_ini鈥   About an hour ago   Up About an hour                               dhcp_relay
602368e364ea        docker-lldp:latest                   "/usr/bin/docker-lld鈥   About an hour ago   Up About an hour                               lldp
6ee737ba8a6e        docker-gbsyncd-vs:latest             "/usr/local/bin/supe鈥   About an hour ago   Up About an hour                               gbsyncd
0e2ebfe47927        docker-syncd-vs:latest               "/usr/local/bin/supe鈥   About an hour ago   Up About an hour                               syncd
4235976d3a3e        docker-teamd:latest                  "/usr/local/bin/supe鈥   About an hour ago   Up About an hour                               teamd
cf452c9c3f76        docker-orchagent:latest              "/usr/bin/docker-ini鈥   About an hour ago   Up About an hour                               swss
c3317f9c8d1d        docker-fpm-frr:latest                "/usr/bin/docker_ini鈥   18 hours ago        Exited (0) 5 seconds ago                       bgp
fa59168dcb00        docker-platform-monitor:latest       "/usr/bin/docker_ini鈥   18 hours ago        Up About an hour                               pmon
af3d94e5e8d8        docker-database:latest               "/usr/local/bin/dock鈥   18 hours ago        Up About an hour                               database
admin@vlab-03:~$ sudo systemctl status bgp
鈼 bgp.service - BGP container
   Loaded: loaded (/lib/systemd/system/bgp.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) since Wed 2020-12-02 05:20:54 UTC; 527ms ago
  Process: 14230 ExecStartPre=/usr/local/bin/bgp.sh start (code=exited, status=0/SUCCESS)
  Process: 14315 ExecStart=/usr/local/bin/bgp.sh wait (code=exited, status=0/SUCCESS)
  Process: 14658 ExecStop=/usr/local/bin/bgp.sh stop (code=exited, status=0/SUCCESS)
 Main PID: 14315 (code=exited, status=0/SUCCESS)

- Why I did it
This change is to fix the bgp crash issue after BGP allow list configuration is loaded.

The issue was a typo introduced in #6006. In that change, the BGP allow list
configuration manager was updated to use a method of common ConfigMgr
for restarting peer groups. However, the method name 'restart_peers' was
used instead of the correct 'restart_peer_groups'.

- How I did it
This change updated the managers_allow_list.py to use correct method
'restart_peer_groups' instead of 'restart_peers' for restarting peer groups.

- How to verify it

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

The issue was a typo introduced in sonic-net#6006. In that change, the BGP allow list
configuration manager was updated to use a method of common ConfigMgr
for restarting peer groups. However, the method name 'restart_peers' was
used instead of the correct 'restart_peer_groups'.

This change updated the managers_allow_list.py to use correct method
'restart_peer_groups' for restarting peer groups.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
@lguohan lguohan merged commit e4ee07b into sonic-net:master Dec 2, 2020
abdosi pushed a commit that referenced this pull request Dec 3, 2020
The issue was a typo introduced in #6006. In that change, the BGP allow list
configuration manager was updated to use a method of common ConfigMgr
for restarting peer groups. However, the method name 'restart_peers' was
used instead of the correct 'restart_peer_groups'.

This change updated the managers_allow_list.py to use correct method
'restart_peer_groups' for restarting peer groups.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
…ic-net#6088)

The issue was a typo introduced in sonic-net#6006. In that change, the BGP allow list
configuration manager was updated to use a method of common ConfigMgr
for restarting peer groups. However, the method name 'restart_peers' was
used instead of the correct 'restart_peer_groups'.

This change updated the managers_allow_list.py to use correct method
'restart_peer_groups' for restarting peer groups.

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
@wangxin wangxin deleted the fix-allow-list-restart-peers branch February 18, 2022 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants