Skip to content

Conversation

mike-dubrovsky
Copy link

Why I did it

Async mode can be configured via "config synchronous_mode disable" CLI.
(see for more info https://github.com/sonic-net/SONiC/blob/master/doc/synchronous-mode/synchronous-mode-cfg.md)
But after async mode become operational (post reboot) the syncd process shutdowns every couple of minutes.

The breakage was introduced via

sonic-net/sonic-sairedis#1362

How I did it

Added newly introduced flex counter operations into lua script to explicitly specify that no redis updates are needed.

The lua script runs by syncd as part of ConsumerTable IPC
(see for more info https://r12f.com/sonic-book/4-2-4-producer-consumer-table.html)

The script invoked with ARGV[2] == "0" for sync mode and with ARGV[2] == "1" for async mode
(ARGV[2] is m_modifyRedis in C++ code).

How to verify it

After enabling async mode via

"config synchronous_mode disable"
"config save -y"
"reboot"

the device comes back up and and syncd container is stable
and commands like "show interfaces status" works

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

  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Description for the changelog

Fixed constant syncd shutdown in async mode.

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

Here are syslogs output example when async mode enabled (the issue is seen):

2025 Jun 4 20:56:59.067942 sonic ERR syncd#syncd: :- run: Runtime error: RedisReply catches system_error: command: *7\r\n$7\r\nEVALSHA\r\n$40\r\n06dfdd67c2f44f63b63b928611c69779957900bf\r\n$1\r\n2\r\n$29\r\nASIC_STATE_KEY_VALUE_OP_QUEUE\r\n$10\r\nASIC_STATE\r\n$3\r\n128\r\n$1\r\n1\r\n, reason: ERR user_script:105: unsupported operation command: set_counter_group, FIXME script: 06dfdd67c2f44f63b63b928611c69779957900bf, on @user_script:105.: Input/output error: Input/output error

2025 Jun 4 20:56:59.068001 sonic NOTICE syncd#syncd: :- sendShutdownRequest: sending switch_shutdown_request notification to OA for switch: oid:0x21000000000000

  sonic-net/sonic-sairedis#1362

to fix - we need explicitly add newly introduced flex counter operations
to the lua script into section for "no redis changes needed".

The lua script runs by syncd as part of ConsumerTable IPC
See for more info https://r12f.com/sonic-book/4-2-4-producer-consumer-table.html

The script invoked with ARGV[2] == "0" for sync mode and with ARGV[2] == "1" for async mode
(ARGV[2] is m_modifyRedis in C++ code).
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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