Skip to content

PR #1111 fix only suppresses WouldBlock - may not address the actual hang root cause #1135

Description

@knoal

Problem

PR #1111 (Fix query() stream hang when CLI subprocess dies mid-run) is overstated. The fix only suppresses WouldBlock on the error enqueue; if the consumer is parked on _message_send.receive() and the buffer is not full, the fix does not help.

Impact

  • The fix may not address the actual hang root cause
  • A real hang could still occur in the unhandled case
  • The test does not exercise the fixed code path - mock_receive raises ProcessError directly, but the original hang was caused by await self._message_send.send(...) blocking on a full/closed buffer

What was audited

MCE audit Tcas1111 (2026-07-19) caught 3 HIGH attacks via F-C:

  1. The test does not actually exercise the fixed code path
  2. P1 (p=0.85 "stream unhangs when CLI dies") is overstated - the fix only suppresses WouldBlock on the error enqueue
  3. The tests use pytest.raises(Exception, match=r"Command failed") - this matches any Exception

Recommended fix

  1. The author should:
    a. Address the actual hang scenario - consumer parked on receive with full buffer
    b. Add a test that exercises the real code path
    c. Use more specific exception matching in tests

Cross-references

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions