Skip to content

[code sync] Merge code from sonic-net/sonic-buildimage:202605 to 202608 - #3142

Merged
mssonicbld merged 5 commits into
Azure:202608from
mssonicbld:sonicbld/202608-merge
Sep 18, 2026
Merged

mssonicbld merged 5 commits into
Azure:202608from
mssonicbld:sonicbld/202608-merge

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator
* c9ab79c25 - (head/202605) [sonic-config-engine] Exclude Mellanox from the default FEC mode (#29530) (2026-09-18) [mssonicbld]
* 50761bfe9 - Fix database_config.json race condition instead of increasing sleep (#29526) (2026-09-18) [mssonicbld]
* b4b06ac0f - [submodule] Update submodule sonic-swss to the latest HEAD automatically (#29600) (2026-09-18) [mssonicbld]
* ce75a18f9 - [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#29549) (2026-09-17) [mssonicbld]<br>```

mssonicbld and others added 5 commits September 17, 2026 19:13
…atically (#29549)

#### Why I did it
src/sonic-utilities
```
* 63a3fc57 - (HEAD -> 202605, origin/202605) Merge pull request #4825 from yizhenzha/counterpoll-completion-fix-202605 (2 days ago) [Vaibhav Hemant Dixit]
* df2967f5 - [counterpoll] Fix bash tab-completion by not requiring CONFIG_DB at import (2 weeks ago) [Yizhen Zhang]
```
#### How I did it
#### How to verify it
#### Description for the changelog
…lly (#29600)

Signed-off-by: mssonicbld <sonicbld@microsoft.com>
…#29526)

#### Why I did it
Follow-up to #25121, which bumped the fixed delay in `waitForAllInstanceDatabaseConfigJsonFilesReady()` from 1s to 5s to work around:

```
sonic-db-cli: :- parseDatabaseConfig: Sonic database config file syntax error >> [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
```

We are still seeing this failure on some devices even after the 5 second delay, since a fixed sleep only narrows the race window rather than eliminating it.

**Root cause**: `docker-database-init.sh` renders `database_config.json` / `database_global.json` with:
```
jinjanate template.j2 > $REDIS_DIR/sonic-db/database_config.json
```
The `>` redirect truncates/creates the destination file *before* the renderer produces any output. `waitForAllInstanceDatabaseConfigJsonFilesReady()` only checks `[ -f $file ]`, so it can observe the file as "ready" while it's still empty or partially written, causing the JSON parse error. A longer sleep just makes the window rarer, not impossible.

#### How I did it
1. `dockers/docker-database/docker-database-init.sh`: render `database_config.json` and `database_global.json` to a `.tmp` file first, then atomically `mv` into place. Readers can never observe a truncated/partial file.
2. `files/build_templates/docker_image_ctl.j2`: replace the fixed `sleep 5` with `waitForFileToBeValidJson()`, which polls (0.2s interval, 30s cap) until each file exists **and** parses as valid JSON, rather than assuming a fixed delay is long enough. This removes the wasted delay on fast devices and removes the failure on slow devices.

#### How to verify it
Built and booted a multi-ASIC image with an artificially slowed-down j2 render (`sleep` inserted before the template renders) and confirmed `database.sh`/`sonic-db-cli` no longer log the JSON parse error, and that the wait exits as soon as the files are valid instead of always waiting the full delay.

#### Which release branch to backport (provide reason below if selected)
- [ ] 202411
- [ ] 202505
- [ ] 202511

Backport reason: fixes an intermittent syslog error on slow-NPU devices seen on release branches after #25121.

Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
…530)

#### Why I did it
Commit 2909a8a (#23978) adds an explicit `"fec": "rs"` to every port entry generated from
`platform.json` / `hwsku.json` whose speed per lane is at least 50G. On Mellanox platforms the
generated port configuration should not carry a FEC mode, so exclude them from that change while
keeping the current behavior for every other platform.

##### Work item tracking
- Microsoft ADO **(number only)**: N/A

#### How I did it
Added one condition to the existing check in `BreakoutCfg.get_config()` in
`src/sonic-config-engine/portconfig.py`, so the `fec` key is skipped when the `asic_type` read
from `/etc/sonic/sonic_version.yml` is `mellanox`. When that file is not present, as in the build
and unit test container, the current behavior is kept, so the tests added by #23978 are
unaffected.

#### How to verify it
On a Mellanox switch, generate the port table from the device files:

```
sonic-cfggen -k <hwsku> -p platform.json -S hwsku.json --print-data
```

No port carries a `fec` key, and `config interface breakout` produces child ports without one. On
any other platform the output is unchanged and still contains `"fec": "rs"`. Checked on an
SN5640: 0 of 514 ports carry `fec` with the change, against 512 of 514 without it, and no other
field differs.

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

- [ ] 202205
- [ ] 202211
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [ ] 202511
- [x] 202605

#### Description for the changelog
Exclude Mellanox from the default FEC mode in the generated port configuration.

Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@mssonicbld
mssonicbld merged commit bb5d24a into Azure:202608 Sep 18, 2026
26 checks passed
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.

1 participant