Skip to content

Drop the DR suite's CancelledError workaround once aiokafka fixes Fetcher.close() #116

Open

Description

@lesnik512

Blocked upstream by aio-libs/aiokafka#1210. Nothing to do until a released aiokafka contains a fix.

Background

aiokafka 0.14.0's AIOKafkaConsumer.stop() raises asyncio.CancelledError when it is called while no broker is reachable. Fetcher.close() cancels each pending fetch task and then awaits it without suppressing the cancellation, and a fetch task that is sleeping in its retry backoff ends with CancelledError. The upstream issue has the details and a standalone repro.

This library's code is not affected: it never calls broker.stop(). The DR suite added in #114 does. Its shutdown-during-outage scenario in tests_dr/test_dr.py catches CancelledError around broker.stop() so the scenario can go on to check redelivery after the cluster comes back.

What to do once aiokafka ships a fix

  • Confirm uv.lock resolves to an aiokafka release that contains the fix.
  • In tests_dr/test_dr.py, catch Exception only around broker.stop() in the shutdown-during-outage scenario, and delete the comment that points at the aiokafka bug.
  • Run just test-dr and check that the scenario passes with broker_stop_error reported as None.

Activity

  1. lesnik512 commented on Oct 28, 2026

    @lesnik512
    MemberAuthor

    The upstream fix is in review as aio-libs/aiokafka#1211. Once a release includes it, raise the aiokafka floor and remove the DR suite's CancelledError tolerance.

  2. added
    blockedWaiting on an external dependency
    and removed
    ready-for-agentFully specified, ready for an AFK agent
    on Oct 29, 2026
  3. lesnik512 commented on Nov 4, 2026

    @lesnik512
    MemberAuthor

    Checked 2026-11-04: still blocked.

    The fix, aio-libs/aiokafka#1211, remains open and unmerged. aiokafka 0.15.0 has shipped, but does not contain it. Keep the DR suite's CancelledError workaround until a released version includes the fix.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedWaiting on an external dependency

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions