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

[action] [PR:15080] Re-add 127.0.0.1/8 when bringing down the interfaces #15454

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

mssonicbld
Copy link
Collaborator

Why I did it

With #5353, 127.0.0.1/16 was added to the lo interface, and then 127.0.0.1/8 was removed. However, when bringing down the lo interface, like during a config reload, 127.0.0.1/16 gets removed, but 127.0.0.1/8 isn't added back to the interface. This means that there's a period of time where 127.0.0.1 is not available at all, and services that need to connect to 127.0.0.1 (such as for redis DB) will fail.

Fixes #15117.
Fixes #14880.

Work item tracking
  • Microsoft ADO (number only): 18637195

How I did it

To fix this, when going down, add 127.0.0.1/8. Add this address before the existing configuration gets removed, so that 127.0.0.1 is available at all times.

Note that running ifdown lo doesn't actually bring down the loopback interface; the interface always stays "physically" up.

How to verify it

On a virtual switch, config reload was run for 8 times, and the docker-wait-any process for the swss container correctly monitored both syncd and teamd. On my setup, prior to this change, there was at least a 50% chance where during swss startup, sonic-db-cli would fail, and teamd would not get monitored by docker-wait-any:

admin@vlab-02:~$ ps -ef | grep docker-wait
root 484870 483774 0 22:59 ? 00:00:00 python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
admin 486833 11367 0 23:02 pts/0 00:00:00 grep docker-wait

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

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

* Re-add 127.0.0.1/8 when bringing down the interfaces

With sonic-net#5353, 127.0.0.1/16 was added to the lo interface, and then
127.0.0.1/8 was removed. However, when bringing down the lo interface,
like during a config reload, 127.0.0.1/16 gets removed, but 127.0.0.1/8
isn't added back to the interface. This means that there's a period of
time where 127.0.0.1 is not available at all, and services that need to
connect to 127.0.01 (such as for redis DB) will fail.

To fix this, when going down, add 127.0.0.1/8. Add this address before
the existing configuration gets removed, so that 127.0.0.1 is available
at all times.

Note that running `ifdown lo` doesn't actually bring down the loopback
interface; the interface always stays "physically" up.

Signed-off-by: Saikrishna Arcot <[email protected]>
@mssonicbld
Copy link
Collaborator Author

Original PR: #15080

@mssonicbld
Copy link
Collaborator Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit 8195e33 into sonic-net:202211 Jun 16, 2023
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.

2 participants