Skip to content

redis: preserve the source endpoint in AsyncDBUpdater - #1259

Merged
qiluo-msft merged 1 commit into
sonic-net:masterfrom
ashutosh-agrawal:redis-local-uds-endpoint
Oct 9, 2026
Merged

qiluo-msft merged 1 commit into
sonic-net:masterfrom
ashutosh-agrawal:redis-local-uds-endpoint

Conversation

@ashutosh-agrawal

@ashutosh-agrawal ashutosh-agrawal commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

What I changed

  • Changed AsyncDBUpdater to create its worker connection with m_db->newConnector(0).
  • The worker still gets its own Redis connection, but it now uses the supplied connector's actual endpoint: either its Unix socket path or its TCP host and port.
  • Added a focused test that starts with a Unix socket connection, queues an asynchronous update, and verifies that the value reaches Redis.

Why

AsyncDBUpdater performs background database writes, including writes used by ZMQ state-table persistence.

The caller can connect to Redis through a Unix socket. However, AsyncDBUpdater previously rebuilt its worker connection with the TCP option forced on. This created the following failure:

  1. The caller's initial Unix socket connection succeeds.
  2. AsyncDBUpdater creates a separate TCP connection for queued writes.
  3. The service therefore still depends on the Redis TCP listener.
  4. If the TCP listener is disabled, asynchronous database updates fail even though the caller connected successfully.

Creating the worker with newConnector() preserves the endpoint already selected by the caller and removes that mismatch.

How the test covers the fix

  • Confirms that the supplied connector uses a Unix socket.
  • Queues an update through AsyncDBUpdater and waits for the worker to process it.
  • Reads the value back through the supplied connector and verifies the written field and value.

@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

/azp run

@azure-pipelines

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

@ashutosh-agrawal
ashutosh-agrawal marked this pull request as ready for review October 7, 2026 18:43
@qiluo-msft
qiluo-msft requested review from StormLiangMS and removed request for StormLiangMS October 7, 2026 23:20
Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
@ashutosh-agrawal
ashutosh-agrawal force-pushed the redis-local-uds-endpoint branch from f54657b to 8d749ac Compare October 8, 2026 04:29
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@ashutosh-agrawal ashutosh-agrawal changed the title redis: centralize endpoint selection redis: preserve the source endpoint in AsyncDBUpdater Oct 8, 2026
@qiluo-msft
qiluo-msft merged commit 3276c55 into sonic-net:master Oct 9, 2026
20 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.

3 participants