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

[202305] [cherry-pick] Improve load_mingraph to wait eth0 restart before exit (#3365) #3371

Merged

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Jun 18, 2024

Improve load_mingraph to wait eth0 restart before exit
This is cherry-pick PR for #3365

Why I did it

load_minigraph will restart eth0, which cause device randomly lost network for 10-20 seconds after load_minigraph
When enable TACACS, this will cause commands randomly failed after load_minigraph

How I did it

Wait interfaces-config and networking service restart after restart all sonic.target services.
Work item tracking
  • Microsoft ADO: 28302676

How to verify it

Pass all test case.
Add new test case.
Verified on SONiC.202305.562827-f73bc5bfb
Manually check on test device:
admin@TEST_DEVICE:~$ date && sudo config load_minigraph -y && date
Wed Jun 12 08:30:59 AM UTC 2024
Stopping SONiC target ...
Running command: /usr/local/bin/sonic-cfggen -H -m -j /etc/sonic/init_cfg.json --write-to-db
Running command: /usr/local/bin/sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/sonic-environment.j2,/etc/sonic/sonic-environment
Running command: config qos reload --no-dynamic-buffer --no-delay
Running command: /usr/local/bin/sonic-cfggen -d --write-to-db -t /usr/share/sonic/device/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers.json.j2,config-db -t /usr/share/sonic/device/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/qos.json.j2,config-db -y /etc/sonic/sonic_version.yml
Buffer calculation model updated, restarting swss is required to take effect
Running command: pfcwd start_default
Restarting SONiC target ...
Enabling container monitoring ...
Reloading Monit configuration ...
Reinitializing monit daemon
Please note setting loaded from minigraph will be lost after system reboot. To preserve setting, run `config save`.
Wed Jun 12 08:32:17 AM UTC 2024
admin@TEST_DEVICE:~$


In syslog, eth0 restart before load_minigraph finish:

2024 Jun 12 08:31:50.743828 TEST_DEVICE INFO systemd-networkd[358]: eth0: Link DOWN
2024 Jun 12 08:31:50.743957 TEST_DEVICE INFO systemd-networkd[358]: eth0: Lost carrier

2024 Jun 12 08:31:58.182663 TEST_DEVICE INFO interfaces-config.sh[15321]: net.ipv6.conf.eth0.accept_ra_defrtr = 0
2024 Jun 12 08:31:58.182777 TEST_DEVICE INFO interfaces-config.sh[15321]: net.ipv6.conf.eth0.accept_ra = 0
2024 Jun 12 08:31:58.182838 TEST_DEVICE INFO interfaces-config.sh[15321]: net.ipv6.conf.eth0.ra_defrtr_metric = 1996489704

2024 Jun 12 08:32:08.572423 TEST_DEVICE INFO systemd-networkd[358]: eth0: Link UP

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

  • 202305
  • 202311
  • 202405

Tested branch (Please provide the tested image version)

will updated with this PR image later.

  • SONiC.202305.562827-f73bc5bfb
  • SONiC.202311.562838-e1f4859bf

Description for the changelog

Improve load_mingraph to wait eth0 restart before exit

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

* Improve load_mingraph to wait eth0 restart before exist
@liuh-80 liuh-80 changed the title Improve load_mingraph to wait eth0 restart before exit (#3365) [202305] Improve load_mingraph to wait eth0 restart before exit (#3365) Jun 18, 2024
@liuh-80 liuh-80 marked this pull request as ready for review June 18, 2024 06:48
@liuh-80 liuh-80 changed the title [202305] Improve load_mingraph to wait eth0 restart before exit (#3365) [202305] [cherry-pick] Improve load_mingraph to wait eth0 restart before exit (#3365) Jun 18, 2024
@liuh-80 liuh-80 requested a review from StormLiangMS June 18, 2024 06:49
Copy link
Contributor

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@StormLiangMS StormLiangMS merged commit 3eb462f into sonic-net:202305 Jun 19, 2024
5 checks passed
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