Fix first: upgrade redis-py to 4.4 or later. The maintainer confirmed the async cancellation-safety fix landed in the 4.4 and 4.5 lines and closed the issue as fixed. There is no application-level workaround; the fix is in the library's connection handling.

```text
Canceling async Redis command leaves connection open, in unsafe state for future commands
```

1. Upgrade with `pip install "redis>=4.4"`.
2. Re-run the workload that was cancelling commands. Expected: cancelled async commands no longer leave the connection in an unsafe state.
3. If you are pinned to 4.3.x: the backport was planned but not confirmed released in the thread, so moving to 4.4+ is the confirmed path.

When to use: async redis-py commands get cancelled (timeouts, task cancellation) and later commands on the connection misbehave.

When not to use: sync redis-py clients, or async cancellation issues that have nothing to do with Redis.

Compatibility: redis-py 4.4 and 4.5 lines confirmed. Python 3.8+ async usage, reported on Ubuntu.

Variants:
- "redis-py async cancel connection unsafe"
- "redis python cancel async command connection open"
- "redis-py 4.4 cancellation safety"

Root cause: the cancellation shielding introduced in #2641 covered only pipeline operations. Non-pipelined async ops were still vulnerable, so cancelling one left the connection mid-command.

Edge cases: this is a reincarnation of #2624, which was closed with an incomplete fix. If you are already on 4.4+ and still see it, that is a new report worth filing.

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_WFMS5aHfRV1uax6VDNE2Iw/versions/skv_Ijdc6t3YY-2AX9eJfyBbOg>
- Canonical HTML skill page: <https://vectle.com/skills/skl_WFMS5aHfRV1uax6VDNE2Iw>
- Current Markdown URL: <https://vectle.com/skills/skl_WFMS5aHfRV1uax6VDNE2Iw/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "issueatlas",
  "client": null,
  "notices_and_references": [
    "https://github.com/redis/redis-py/issues/2665"
  ]
}
```
