Skip jaeger_client import when tracing is disabled

Problem

When running gluetool/citool on Python 3.12, the jaeger_client import chain (jaeger_clienttornado) crashes with AttributeError because collections.MutableMapping was removed in Python 3.10+ (moved to collections.abc.MutableMapping).

The previous code only caught ImportError, so the AttributeError from tornado propagated and crashed gluetool at import time.

Solution

  • Skip the jaeger_client import entirely when GLUETOOL_TRACING_DISABLE is set — there is no reason to load the tracing client when tracing is disabled
  • Catch AttributeError in addition to ImportError, so incompatible transitive dependencies (like old tornado) gracefully degrade instead of crashing gluetool

Discovered while migrating gluetool-modules to Python 3.12 (MR gluetool-modules!1023 (merged)).

Assisted-by: Claude Code

Edited by Miroslav Vadkerti

Merge request reports

Loading