Skip to content

perf(reliability): FailurePatternDetector uses sync Redis on async paths #10635

Closed

Description

@mrveiss

Discovered in review of #10631. services/failure_pattern_detector.py declares detect_pattern/learn_pattern as async but uses a sync Redis client (get_redis_client(async_client=False), line 94) and calls blocking redis.get/set/sadd (lines 119/242/249) directly — so awaiting them blocks the event loop. Now reachable on the workflow failure path (#10628). Fix: make the detector async-native (async_client=True + await) or wrap the sync calls in asyncio.to_thread, and add a bounded timeout. Part of #10602.

Activity

  1. github-actions commented on Jul 2, 2026

    @github-actions
    Contributor

    PR #10869 (merged to Dev_new_gui) references this issue with a close keyword.

    perf(reliability): make FailurePatternDetector async-native Redis (#10635)

    If this issue is fully resolved, close it manually. If work remains, no action is needed.

  2. mrveiss commented on Jul 2, 2026

    @mrveiss
    OwnerAuthor

    Closed — merged to Dev_new_gui via #10869 (squash 7ba2d3d). FailurePatternDetector now inherits AsyncRedisClientMixin, all Redis I/O is awaited and bounded by asyncio.wait_for(timeout=2.0s). Verified: py_compile OK, test_failure_pattern_wiring 6/6 pass, caller audit (workflow_runner.py:338-339 already await). Discovery: #10870 (TestCausalErrorRecovery AsyncMock).

  3. mrveiss commented on Jul 6, 2026

    @mrveiss
    OwnerAuthor

    Merged to Dev_new_gui (d4ce8ef94). FailurePatternDetector now uses async Redis (AsyncRedisClientMixin) on all async paths; 11 async-contract tests. Surfaced a follow-up bytes-key bug (#10906). Batch #10440.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions