Skip to content

redis: use local sockets by default in sonic-db-cli - #1260

Draft
ashutosh-agrawal wants to merge 1 commit into
sonic-net:masterfrom
ashutosh-agrawal:redis-cli-local-uds-default
Draft

ashutosh-agrawal wants to merge 1 commit into
sonic-net:masterfrom
ashutosh-agrawal:redis-cli-local-uds-default

Conversation

@ashutosh-agrawal

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

Copy link
Copy Markdown
Member

What I did

  • Changed sonic-db-cli to use the configured Unix socket for local databases by default.
  • Kept TCP for redis_chassis.server and database entries that do not have a Unix socket.
  • Added -t / --tcp as an explicit TCP override.
  • Kept the existing -s / --unixsocket behavior.

Why I did it

Local sonic-db-cli calls should keep working after the local Redis TCP listener is disabled. The CLI already has the socket, host, and port for each database, so it can make the choice directly without adding a shared resolver to swss-common.

This change leaves chassis and remote database entries on TCP while moving ordinary local and namespace database calls to Unix sockets.

How I verified it

  • Confirmed that the diff is limited to sonic-db-cli and its existing help-output fixture.
  • Confirmed that the commit passes the DCO check.
  • Local tests were not run for this draft. Automated checks are pending on the new head.

@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 force-pushed the redis-cli-local-uds-default branch from 18f3836 to 8ec54fb Compare October 6, 2026 21:52
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@ashutosh-agrawal

Copy link
Copy Markdown
Member Author

/azp retry

@azure-pipelines

Copy link
Copy Markdown
Command 'retry' is not supported by Azure Pipelines.

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@ashutosh-agrawal

Copy link
Copy Markdown
Member Author

/azpw retry

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1240625:

✅Stage Build:

  • Job amd64: retried.

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
@ashutosh-agrawal
ashutosh-agrawal force-pushed the redis-cli-local-uds-default branch from 8ec54fb to ff817da Compare October 9, 2026 05:30
@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 sonic-db-cli: prefer local Unix sockets redis: use local sockets by default in sonic-db-cli Oct 9, 2026
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