#513 [ENGINE/Race] Sidecar telemetry singleton __init__ race

closed medium Created 2025-12-17 14:59 · Updated 2025-12-17 15:56

Description

Edit
**File:** engine/sidecar_telemetry.py:74-81 **Problem:** Singleton pattern with __new__ but attribute initialization happens in __init__ without lock. __init__ is called every time instance is accessed, not just on creation. **Severity:** MEDIUM **Fix:** Add lock to __init__: ```python def __init__(self) -> None: with self._lock: if getattr(self, '_initialized', False): return self._pool: ConnectionPool | None = None self._conninfo: str | None = None self._enabled = True self._initialized = True ``` **Impact:** Attribute corruption on concurrent first access.

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...