Skip to content

Fix Kafka rebalancing when opentracing is not installed - #787

Merged
wbarnha merged 1 commit into
faust-streaming:masterfrom
burritoatspoton:fix-opentracing-soft-dependency
Aug 19, 2026
Merged

Fix Kafka rebalancing when opentracing is not installed#787
wbarnha merged 1 commit into
faust-streaming:masterfrom
burritoatspoton:fix-opentracing-soft-dependency

Conversation

@burritoatspoton

Copy link
Copy Markdown
Contributor

Note: Before submitting this pull request, please review our contributing
guidelines
.

Description

Mitigate AttributeErrors happening when opentracing extra is missing.

Fixes #786

@burritoatspoton burritoatspoton changed the title Fix Kafka rebalancing when opentracing is not installed Fix Kafka rebalancing when opentracing is not installed Aug 19, 2026
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.20%. Comparing base (da5e8c1) to head (b7f7a4d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #787   +/-   ##
=======================================
  Coverage   96.20%   96.20%           
=======================================
  Files         110      110           
  Lines       11790    11790           
  Branches     1281     1281           
=======================================
  Hits        11343    11343           
  Misses        350      350           
  Partials       97       97           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wbarnha

wbarnha commented Aug 19, 2026

Copy link
Copy Markdown
Member

Thank you for the patch, this should've been originally included. I'll get this merged and released ASAP!

@wbarnha
wbarnha merged commit a554f25 into faust-streaming:master Aug 19, 2026
35 of 36 checks passed
wbarnha pushed a commit that referenced this pull request Aug 19, 2026
#787 landed the same root-cause fix for #786 while this branch was open,
so defer to it: `faust/utils/_opentracing.py` is taken from master
verbatim, and its parity tests (`test_opentracing_shim.py`) stand as the
guard for the stand-in itself.

What master does not have, and this branch keeps:

`traced_from_parent_span()` still assumes the parent span it is given has
a tracer. Master's fix means the stand-in always supplies one, so the
reported crash is gone either way -- but a span is whatever the
configured tracer hands back, and tracing is instrumentation. It now runs
the wrapped function untraced rather than failing its caller.

The tests are cut down to what `test_opentracing_shim.py` does not
already cover, and moved to `test_tracing.py` to match: the tracerless
parent (by argument and through the context variable), error propagation,
and both rebalance callbacks with the stand-in substituted for the real
library -- the wiring the parity tests note they do not reach.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sejq9tYzzeqWeZAgA3EB6s
@burritoatspoton
burritoatspoton deleted the fix-opentracing-soft-dependency branch August 20, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kafka rebalancing fails when opentracing is not installed

2 participants