Support Redis Unix sockets - #2810
Open
jorge-barroso wants to merge 5 commits into
Open
jorge-barroso wants to merge 5 commits into
jorge-barroso wants to merge 5 commits into
Conversation
Accept redis+unix URLs in Redis service initialization, using the existing limits adapter for sessions, concurrency locks and bucket limits. Document configuration and add initialization and real Unix socket regression tests, including Flask-Limiter enforcement. Validated with Python 3.12.8 and unchanged uv.lock dependencies (limits 4.0.1, redis 5.2.1): 936 passed, 1 skipped using Redis 6.2.16. The five Unix socket regression cases fail against the original initializer.
jorge-barroso
requested review from
acasajus,
cquintana92 and
nguyenkims
as code owners
September 13, 2026 03:41
jorge-barroso
marked this pull request as draft
September 13, 2026 03:45
Follow the existing test setup by requiring a running Redis service over TCP and a Unix socket. Remove per-test server startup and automatic skips, and isolate rate-limit keys for repeatable runs against shared Redis. Configure the single Redis 6 CI container with both listeners and document the socket prerequisite. Nine focused tests pass against Arch Valkey with the pinned Python environment; lint and formatting checks pass.
Match the original action's direct container launch without adding a readiness loop. Retain the shared socket mount, runner ownership and disabled snapshots for the ephemeral test container.
jorge-barroso
marked this pull request as ready for review
September 14, 2026 22:32
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.
I self-host it and wanted to connect to Redis over a Unix socket for filesystem-based access control and one less TCP listener. Since the pinned limits version already supports this, I thought it would be useful to contribute the small change here too.
This PR accepts redis+unix:// URLs during Redis service initialization, without changing any dependencies. It adds tests covering sessions, concurrency locks and rate limiting, including Flask-Limiter. The tests use the existing Redis instance and the contributor instructions and CI setup now account for both TCP and socket connections.
The full suite passed with Python 3.12.8 and the unchanged lockfile: 936 passed, 1 skipped, using Redis 6.2.16. After adjusting the tests to use a shared instance, all nine Redis tests also passed against Valkey on Arch Linux. The revised CI setup still needs validation on GitHub but it's just a manual way to trigger the same action, just adding the socket exposure.
First time contributing to this project so I'm happy to tweak anything to better fit how you’d like this handled 🙂