Repository navigation
redis: stop configuring notifications on client connect - #1257
Merged
qiluo-msft merged 1 commit intoOct 7, 2026
Merged
qiluo-msft merged 1 commit into
qiluo-msft merged 1 commit into
Conversation
SONiC Redis images already enable keyspace notifications in redis.conf. Keep that server-wide setting under server startup control so read-only clients do not need CONFIG write permission. Add a regression test that detects CONFIG SET on both older Redis releases and releases that report subcommand statistics separately. Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Member
Author
|
/azpw retry |
Collaborator
|
Retrying failed(or canceled) jobs... |
Collaborator
|
Retrying failed(or canceled) stages in build 1240364: ✅Stage Test:
|
qiluo-msft
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
DBInterfacecurrently sendsCONFIG SET notify-keyspace-events KEAwhen it creates its first connection to a database. Keyspace notification selection is a server-wide setting, so configuring it from each client duplicates Redis startup configuration and makes connection creation change global server state.This behavior dates back to the original Python SDK. At that time, the SDK enabled notifications itself so its blocking reads could wait for missing data. The C++ implementation added in sonic-swss-common PR #387 retained that behavior for compatibility.
SONiC later found that client-owned setup was unreliable for chassis databases because a Redis process could need to publish events before any local
DBInterfaceconnection existed. sonic-buildimage PR #12540 moved the setting intoredis.conf, where it is applied when each Redis process starts. The connection-time write is now redundant.What changed
CONFIG SETfromDBInterface::_onetime_connect().CONFIG SET.Compatibility
SONiC Redis images already enable
notify-keyspace-events AKEat startup:dockers/docker-database/Dockerfile.common.j2, shared by the database image anddocker-sonic-vsThe sonic-swss-common development and CI setup also enables
AKEbefore running Redis-dependent tests. The repository README already documents this Redis server requirement for standalone development.Validation
test_DBInterfacePython test, including pub/sub keyspace notifications and a blocking read; it passed.