Skip to content

Flaky Kafka scenario: invalid subscription leaves no client running #614

Closed

Description

@HosseinNejatiJavaremi

features/kafka_clients_spans.feature:115 ("A sync consumer that fails with an invalid subscription leaves no client running", example @1.2) failed once in CI on PR #608, which only touched pyproject.toml and uv.lock. The rerun passed. The other 105 scenarios in the feature passed both times.

Evidence: run 44899443830, job "behave (Python 3.14, Kafka (clients and spans))". The log shows only the failing scenario name, with no assertion text.

Checklist

  • reproduce locally or in CI loops and capture the assertion error
  • fix the race or wait condition in the step or adapter, without sleep loops
  • confirm the scenario passes repeatedly

Activity

  1. added
    bug
    area:kafka
    priority:low
    tests
    on Nov 21, 2026
  2. HosseinNejatiJavaremi commented on Nov 21, 2026

    @HosseinNejatiJavaremi
    MemberAuthor

    Fixed in #621. Not reproduced locally or in CI loops: the cause is found by reading the code. _rdkafka_thread_count listed /proc/self/task and opened each comm file, so a librdkafka thread of an earlier scenario exiting in between raised FileNotFoundError (a step error with no assertion text). The step also compared before/after counts, which older clients shutting down could shift. The helper now collects thread ids, skips vanished threads, and counts only new ids. The scenario passed 6 of 6 runs and the whole feature passed. Reopen if the flake returns.

  3. github-actions commented on Nov 21, 2026

    @github-actions
    Contributor

    Merged #621: fix(kafka): stop the no-client-left check from racing with exiting threads

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

    area:kafkabugpriority:lowtests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions