Skip to content

swss.sh should check service enabled instead exists#24754

Merged
qiluo-msft merged 1 commit intosonic-net:masterfrom
qiluo-msft:qiluo/waitteamd
Dec 8, 2025
Merged

swss.sh should check service enabled instead exists#24754
qiluo-msft merged 1 commit intosonic-net:masterfrom
qiluo-msft:qiluo/waitteamd

Conversation

@qiluo-msft
Copy link
Collaborator

@qiluo-msft qiluo-msft commented Dec 5, 2025

Why I did it

If teamd feature is disabled,

sudo config feature state teamd disabled

swss service should not wait on team container at all. Currently there is a process

python3 /usr/bin/docker-wait-any -s swss -d syncd teamd

However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

python3 /usr/bin/docker-wait-any -s swss -d syncd
Work item tracking

How I did it

How to verify it

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

  • 202205
  • 202211
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

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)

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft changed the title We should check service enabled instead exists swss.sh should check service enabled instead exists Dec 5, 2025
@qiluo-msft qiluo-msft marked this pull request as ready for review December 5, 2025 03:12
@qiluo-msft qiluo-msft requested a review from lguohan as a code owner December 5, 2025 03:12
Copilot AI review requested due to automatic review settings December 5, 2025 03:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where the swss service was attempting to wait on teamd even when the teamd feature was disabled. The root cause was that the helper function was checking for service existence rather than checking if the service was enabled.

Key Changes:

  • Renamed check_service_exists() to check_service_enabled() to better reflect its purpose
  • Changed implementation from systemctl list-units to systemctl is-enabled to check service enablement status
  • Updated all call sites (radv and teamd dependency checks) to use the new function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qiluo-msft qiluo-msft merged commit d3b5194 into sonic-net:master Dec 8, 2025
28 of 29 checks passed
kewei-arista pushed a commit to kewei-arista/sonic-buildimage that referenced this pull request Dec 8, 2025
Why I did it
If teamd feature is disabled,

sudo config feature state teamd disabled
swss service should not wait on team container at all. Currently there is a process

python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

python3 /usr/bin/docker-wait-any -s swss -d syncd
Work item tracking
Microsoft ADO (number only):
Fixing Bug: dockers flapping on SONiC fan out switch due to behavior change in docker-wait-any-rs compared to docker-wait-any when the docker does not exist sonic-net#24730
xwjiang-ms added a commit to xwjiang-ms/sonic-buildimage that referenced this pull request Dec 10, 2025
…)"

This reverts commit d3b5194.

Signed-off-by: xiaweijiang <xiaweijiang@microsoft.com>
StormLiangMS pushed a commit that referenced this pull request Dec 10, 2025
)

Reverts #24754 since it's causing pc/test_po_cleanup.py and autorestart/test_container_autorestart.py failure on multi-asic t1

pc/test_po_cleanup.py:
hdwhdw pushed a commit to hdwhdw/sonic-buildimage that referenced this pull request Dec 18, 2025
Why I did it
If teamd feature is disabled,

sudo config feature state teamd disabled
swss service should not wait on team container at all. Currently there is a process

python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

python3 /usr/bin/docker-wait-any -s swss -d syncd
Work item tracking
Microsoft ADO (number only):
Fixing Bug: dockers flapping on SONiC fan out switch due to behavior change in docker-wait-any-rs compared to docker-wait-any when the docker does not exist sonic-net#24730

Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
hdwhdw pushed a commit to hdwhdw/sonic-buildimage that referenced this pull request Dec 18, 2025
…)" (sonic-net#24794)

Reverts sonic-net#24754 since it's causing pc/test_po_cleanup.py and autorestart/test_container_autorestart.py failure on multi-asic t1

pc/test_po_cleanup.py:

Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
xwjiang-ms pushed a commit to xwjiang-ms/sonic-buildimage that referenced this pull request Dec 22, 2025
Why I did it
If teamd feature is disabled,

sudo config feature state teamd disabled
swss service should not wait on team container at all. Currently there is a process

python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

python3 /usr/bin/docker-wait-any -s swss -d syncd
Work item tracking
Microsoft ADO (number only):
Fixing Bug: dockers flapping on SONiC fan out switch due to behavior change in docker-wait-any-rs compared to docker-wait-any when the docker does not exist sonic-net#24730

Signed-off-by: xiaweijiang <xiaweijiang@microsoft.com>
xwjiang-ms added a commit to xwjiang-ms/sonic-buildimage that referenced this pull request Dec 22, 2025
…)" (sonic-net#24794)

Reverts sonic-net#24754 since it's causing pc/test_po_cleanup.py and autorestart/test_container_autorestart.py failure on multi-asic t1

pc/test_po_cleanup.py:

Signed-off-by: xiaweijiang <xiaweijiang@microsoft.com>
qiluo-msft added a commit to qiluo-msft/sonic-buildimage that referenced this pull request Jan 13, 2026
qiluo-msft added a commit that referenced this pull request Jan 18, 2026
…4794) (#25037)

#### Why I did it
If teamd feature is disabled,
```
sudo config feature state teamd disabled
```

swss service should not wait on team container at all. Currently there is a process
```
python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
```

However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

```
python3 /usr/bin/docker-wait-any -s swss -d syncd
```


##### Work item tracking
- Microsoft ADO **(number only)**:
- Fixing #24730
mssonicbld added a commit to mssonicbld/sonic-buildimage that referenced this pull request Jan 19, 2026
)" (sonic-net#24794)

#### Why I did it
If teamd feature is disabled,
```
sudo config feature state teamd disabled
```

swss service should not wait on team container at all. Currently there is a process
```
python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
```

However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

```
python3 /usr/bin/docker-wait-any -s swss -d syncd
```

##### Work item tracking
- Microsoft ADO **(number only)**:
- Fixing sonic-net#24730

#### How I did it

#### How to verify it

<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->

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

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 202205
- [ ] 202211
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505

#### Tested branch (Please provide the tested image version)

<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->

- [ ] <!-- image version 1 -->
- [ ] <!-- image version 2 -->

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

<!--
 Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
jasonbridges pushed a commit to jasonbridges/sonic-buildimage that referenced this pull request Jan 22, 2026
Why I did it
If teamd feature is disabled,

sudo config feature state teamd disabled
swss service should not wait on team container at all. Currently there is a process

python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

python3 /usr/bin/docker-wait-any -s swss -d syncd
Work item tracking
Microsoft ADO (number only):
Fixing Bug: dockers flapping on SONiC fan out switch due to behavior change in docker-wait-any-rs compared to docker-wait-any when the docker does not exist sonic-net#24730
jasonbridges pushed a commit to jasonbridges/sonic-buildimage that referenced this pull request Jan 22, 2026
…)" (sonic-net#24794)

Reverts sonic-net#24754 since it's causing pc/test_po_cleanup.py and autorestart/test_container_autorestart.py failure on multi-asic t1

pc/test_po_cleanup.py:
mssonicbld added a commit that referenced this pull request Feb 1, 2026
…4794) (#25123)

#### Why I did it
If teamd feature is disabled,
```
sudo config feature state teamd disabled
```

swss service should not wait on team container at all. Currently there is a process
```
python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
```

However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

```
python3 /usr/bin/docker-wait-any -s swss -d syncd
```

##### Work item tracking
- Microsoft ADO **(number only)**:
- Fixing #24730

#### How I did it

#### How to verify it

<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->

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

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 202205
- [ ] 202211
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505

#### Tested branch (Please provide the tested image version)

<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->

- [ ] <!-- image version 1 -->
- [ ] <!-- image version 2 -->

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

<!--
 Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Mar 6, 2026
Why I did it
If teamd feature is disabled,

sudo config feature state teamd disabled
swss service should not wait on team container at all. Currently there is a process

python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

python3 /usr/bin/docker-wait-any -s swss -d syncd
Work item tracking
Microsoft ADO (number only):
Fixing Bug: dockers flapping on SONiC fan out switch due to behavior change in docker-wait-any-rs compared to docker-wait-any when the docker does not exist sonic-net#24730

Signed-off-by: Feng Pan <fenpan@microsoft.com>
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Mar 6, 2026
…)" (sonic-net#24794)

Reverts sonic-net#24754 since it's causing pc/test_po_cleanup.py and autorestart/test_container_autorestart.py failure on multi-asic t1

pc/test_po_cleanup.py:

Signed-off-by: Feng Pan <fenpan@microsoft.com>
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Mar 6, 2026
)" (sonic-net#24794) (sonic-net#25037)

#### Why I did it
If teamd feature is disabled,
```
sudo config feature state teamd disabled
```

swss service should not wait on team container at all. Currently there is a process
```
python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
```

However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

```
python3 /usr/bin/docker-wait-any -s swss -d syncd
```

##### Work item tracking
- Microsoft ADO **(number only)**:
- Fixing sonic-net#24730

Signed-off-by: Feng Pan <fenpan@microsoft.com>
dprital pushed a commit that referenced this pull request Mar 19, 2026
…4794) (#25037)

#### Why I did it
If teamd feature is disabled,
```
sudo config feature state teamd disabled
```

swss service should not wait on team container at all. Currently there is a process
```
python3 /usr/bin/docker-wait-any -s swss -d syncd teamd
```

However, a thread inside /usr/bin/docker-wait-any is actually crashed, and the behavior is same as ignoring teamd. It still keep the whole system working.

The root fix should check service enabled instead exists, so it will not wait-any on teamd at all. After this PR,

```
python3 /usr/bin/docker-wait-any -s swss -d syncd
```

##### Work item tracking
- Microsoft ADO **(number only)**:
- Fixing #24730

Signed-off-by: dprital <drorp@nvidia.com>
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.

6 participants