#513 [ENGINE/Race] Sidecar telemetry singleton __init__ race
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 AllLoading audit history...