You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I attempted this in #7019 (widening redis >=6.4,<8.0 → <9.0) and backed it out, because redis-py 8 hangs on Python 3.10 and 3.11. Recording the diagnosis here so the next attempt starts from evidence rather than repeating it.
The blocker
With REFLEX_REDIS_URL set, three redis-backed tests hang indefinitely on Python ≤ 3.11 under redis-py 8.1.0:
The first one matters most: it is not a teardown artifact. It hangs on get_state, which is a normal runtime path, so this is not "just the tests".
In CI this presents as the unit-tests workflow being cancelled, not failed — Run unit tests w/ redis sits for ~26 minutes on ubuntu 3.10/3.11 until the 30-minute job timeout kills it, while 3.12/3.13/3.14 finish the same step in 1–2 minutes. Because the conclusion is cancelled, it reads as "nothing failed" on the checks API and in the check-suite webhook.
A/B that isolates it
Same interpreter, same machine, same command, nothing else running, against a flushed redis:
So it is redis-py 8, not a pre-existing 3.11 problem, and not the sandbox. (The 15 unrelated failures present in both runs are local environment noise — pyi-golden tests needing a working ruff, and two IPv6-dependent test_processes tests.)
Use --timeout-method=signal, not thread. The hanging tests are async, so with thread the stack dump shows only pytest's own frames and never names the test; signal raises inside the test and reports it by name.
Notes for whoever picks this up
The three hangs are context-dependent: tests/units/test_app.pypasses in isolation (147 tests, 1.85s) with redis-py 8. They only hang in a full-suite run, which suggests accumulated client/connection state matters.
Worth checking against the redis-py 8.0 defaults changes: max_connections 100, socket_timeout/socket_connect_timeout 5s, and retries moving from 3 to 10 attempts with exponential jitter backoff.
The redis-8 response-type narrowing (bytes | str → bytes | None at the call sites in istate/manager/redis.py and utils/token_manager.py) is already merged in Refresh outdated dependencies flagged on the release branch #7019 and verified clean under pyright with both 7.4.1 and 8.1.0, so that groundwork does not need redoing.
redis is filtered out of the backend outdated-dependency check in Refresh outdated dependencies flagged on the release branch #7019 with a pointer here, so it will stop showing up as a perpetually-stale row until this is resolved. Remove it from that filter when the bound widens.
Tracking correction: the blocker described in my comment above now has its own issue — #7026 — so it is visible from the issue list rather than buried in a comment here.
This issue stays open as the request; #7026 carries the diagnosis, the A/B isolating it to redis-py 8, the reproduction recipe, and the checklist. Closing #7026 should unblock closing this one.
One amendment to my earlier comment: it said the fixture-leak fix in #7019 addressed the orphaned _lock_task, framed as if that were the hang. It removed one orphaned task, but three separate hangs remained — including test_app.py::test_initialize_with_state, which hangs on get_state rather than in teardown. #7026 has the corrected picture.
Independent confirmation from a downstream user for the Python 3.12+ side of the matrix in #7026:
Reflex 0.10.0 (lock-resolved with redis 7.4.1), then redis==8.1.0 force-installed over it (pip reports the expected redis<8.0 conflict), Python 3.13, Redis server 8.10.2.
The app's own unit tests (141) pass identically with redis-py 7.4.1 and 8.1.0.
StateManagerRedis against the real server behaves identically with both client versions: modify_state/get_state round trip, 8 concurrent modify_state calls on the same token (locks, Lua scripts, pub/sub, keyspace notifications) end at the expected value, keyspace notifications get enabled via config_set.
So at least for Python >= 3.12 the redis<8.0 bound looks purely precautionary. If it helps users on 3.12+ in the meantime, a split like redis>=6.4,<9.0; python_version >= "3.12" and redis>=6.4,<8.0; python_version < "3.12" would let them resolve redis-py 8 without waiting for the 3.11 fix. Happy to run further checks on 3.13 if useful.
Activity
linear-code commentedon Jul 14, 2026
ENG-10324
masenf commentedon Sep 1, 2026
I attempted this in #7019 (widening
redis >=6.4,<8.0→<9.0) and backed it out, because redis-py 8 hangs on Python 3.10 and 3.11. Recording the diagnosis here so the next attempt starts from evidence rather than repeating it.The blocker
With
REFLEX_REDIS_URLset, three redis-backed tests hang indefinitely on Python ≤ 3.11 under redis-py 8.1.0:tests/units/test_app.py::test_initialize_with_stateapp.state_manager.get_state(...)— parked in the event-loop selector withtimeout = -1tests/units/istate/manager/test_redis.py::test_modify_oplocktests/units/test_state.py::test_on_load_internal_supersedes_previous_navigationThe first one matters most: it is not a teardown artifact. It hangs on
get_state, which is a normal runtime path, so this is not "just the tests".In CI this presents as the
unit-testsworkflow being cancelled, not failed —Run unit tests w/ redissits for ~26 minutes on ubuntu 3.10/3.11 until the 30-minute job timeout kills it, while 3.12/3.13/3.14 finish the same step in 1–2 minutes. Because the conclusion iscancelled, it reads as "nothing failed" on the checks API and in the check-suite webhook.A/B that isolates it
Same interpreter, same machine, same command, nothing else running, against a flushed redis:
So it is redis-py 8, not a pre-existing 3.11 problem, and not the sandbox. (The 15 unrelated failures present in both runs are local environment noise — pyi-golden tests needing a working
ruff, and two IPv6-dependenttest_processestests.)How to reproduce
Use
--timeout-method=signal, notthread. The hanging tests areasync, so withthreadthe stack dump shows only pytest's own frames and never names the test;signalraises inside the test and reports it by name.Notes for whoever picks this up
tests/units/test_app.pypasses in isolation (147 tests, 1.85s) with redis-py 8. They only hang in a full-suite run, which suggests accumulated client/connection state matters.max_connections100,socket_timeout/socket_connect_timeout5s, and retries moving from 3 to 10 attempts with exponential jitter backoff.StateManagerRedis._lock_taskresists cancellation at loop teardown under redis-py 8 on ≤3.11 (cancelling=1while awaiting a freshly created future). Refresh outdated dependencies flagged on the release branch #7019 fixed the test fixture that orphaned it, but the underlying cancellation behavior is unexplained and may share a root cause with the hangs above.bytes | str→bytes | Noneat the call sites inistate/manager/redis.pyandutils/token_manager.py) is already merged in Refresh outdated dependencies flagged on the release branch #7019 and verified clean under pyright with both 7.4.1 and 8.1.0, so that groundwork does not need redoing.redisis filtered out of the backend outdated-dependency check in Refresh outdated dependencies flagged on the release branch #7019 with a pointer here, so it will stop showing up as a perpetually-stale row until this is resolved. Remove it from that filter when the bound widens.Generated by Claude Code
Back out the redis 8.x widening: it hangs on Python 3.10/3.11
masenf commentedon Sep 1, 2026
Tracking correction: the blocker described in my comment above now has its own issue — #7026 — so it is visible from the issue list rather than buried in a comment here.
This issue stays open as the request; #7026 carries the diagnosis, the A/B isolating it to redis-py 8, the reproduction recipe, and the checklist. Closing #7026 should unblock closing this one.
One amendment to my earlier comment: it said the fixture-leak fix in #7019 addressed the orphaned
_lock_task, framed as if that were the hang. It removed one orphaned task, but three separate hangs remained — includingtest_app.py::test_initialize_with_state, which hangs onget_staterather than in teardown. #7026 has the corrected picture.Generated by Claude Code
Point the redis outdated-check filter at the blocker issue
Record the new dependency holds in the outdated-check config
Record the new dependency holds in the outdated-check config
Refresh outdated dependencies flagged on the release branch (#7019)
Marvelous2095 commentedon Oct 25, 2026
Independent confirmation from a downstream user for the Python 3.12+ side of the matrix in #7026:
redis 7.4.1), thenredis==8.1.0force-installed over it (pipreports the expectedredis<8.0conflict), Python 3.13, Redis server 8.10.2.StateManagerRedisagainst the real server behaves identically with both client versions:modify_state/get_stateround trip, 8 concurrentmodify_statecalls on the same token (locks, Lua scripts, pub/sub, keyspace notifications) end at the expected value, keyspace notifications get enabled viaconfig_set.So at least for Python >= 3.12 the
redis<8.0bound looks purely precautionary. If it helps users on 3.12+ in the meantime, a split likeredis>=6.4,<9.0; python_version >= "3.12"andredis>=6.4,<8.0; python_version < "3.12"would let them resolve redis-py 8 without waiting for the 3.11 fix. Happy to run further checks on 3.13 if useful.Allow redis-py 8; drop its socket timeout to fix the Python 3.11 canc…