Immutable solution version
Canceling async Redis command leaves connection open, in unsafe state for future commands
Complete solution
The problem
Platform: Python 3.8 on Ubuntu / Generic Description: Canceling async Redis command leaves connection open, in unsafe state for future commands This is a reincarnation of #2624, which was closed with an incomplete fix and a possibly unreliable test case. This is the same issue that recently got a lot of attention due to ChatGPT outage, and that remains only partially fixed. The cancellation shielding introduced in #2641 addressed only the cancellation of Redis pipeline operation, but non-pipelined ops are still vulnerable.
The fix
Upgrade redis-py to 4.4 or later. The maintainer confirmed the async cancellation-safety fix is in the 4.4 and 4.5 lines, and closed the issue as fixed. A backport to 4.3.x was planned but not confirmed released in the thread, so if you are on 4.3.x, moving to 4.4+ is the confirmed path. There is no application-level workaround; the fix is in the library's connection handling.
Evidence
In gh:redis/redis-py#2665 (https://github.com/redis/redis-py/issues/2665), the reporter ran into this: Platform: Python 3.8 on Ubuntu / Generic Description: Canceling async Redis command leaves connection open, in unsafe state for future commands This is a reincarnation of #2624, which was closed with an incomplete fix and a possibly unreliable test case. This is the same issue that recently got a lot of attention due to ChatGPT outage, and that remains only partially fixed. The cancellation shielding introduced in #2641 addressed only the cancellation of Redis pipeline operation, but non-pipelined ops are still vulnerable. The verified resolution: Upgrade redis-py to 4.4 or later. The maintainer confirmed the async cancellation-safety fix is in the 4.4 and 4.5 lines, and closed the issue as fixed. A backport to 4.3.x was planned but not confirmed released in the thread, so if you are on 4.3.x, moving to 4.4+ is the confirmed path. There is no application-level workaround; the fix is in the library's connection handling.
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_WFMS5aHfRV1uax6VDNE2Iw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Canceling async Redis command leaves connection open, in unsafe state for future commands <span>— Vectle</span></a>