Bug (verified vs SQLAlchemy 2.0.49): on GC-cleanup of an abandoned async connection, _finalize_fairy routes through fairy.detach(), which nulls the record's dbapi_connection so NullPool's close is a no-op (the `close` event never fires) then emits `detach` with the record. Listening only to close/invalidate left the marker unpopped, so db_connections_open leaked upward and never reset until restart. Listen to `detach` too — it carries the ConnectionRecord and the marker dedupes, so exactly one decrement occurs. Also: strip a bare PR-number provenance tag from the test docstring (plastic-labs comment-reconciliation rule); disambiguate db_connections_open from the existing db_pool_connections; note in initialize_bounded_metrics that DB-instrumentation metrics zero-init in their registrar. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| conftest.py | ||
| test_cross_agent_trace.py | ||
| test_db_connection_metrics.py | ||
| test_embedding_call_event.py | ||
| test_embedding_trace.py | ||
| test_emit_function.py | ||
| test_emitter.py | ||
| test_events.py | ||
| test_langfuse_exporter.py | ||
| test_metric_zero_init.py | ||
| test_representation_v2_fields.py | ||
| test_sentry_before_send.py | ||
| test_sentry_sampler.py | ||
| test_summary_v2_fields.py | ||
| test_trace_events.py | ||