-
-
Notifications
You must be signed in to change notification settings - Fork 225
fix(python-sdk): warn on silent sidecar cleanup failures#1128
fix(python-sdk): warn on silent sidecar cleanup failures #1128realfishsam wants to merge 1 commit into
Conversation
realfishsam
commented
Jun 16, 2026
PR Review: PASS (NOT VERIFIED)
What This Does
Replaces silent exception handlers in the Python SDK market-date conversion, connection-retry sidecar restart, sidecar process termination, SIGKILL escalation, and stale lock cleanup paths with RuntimeWarning diagnostics. Consumers get warning-level visibility into malformed date/cleanup failures while the existing fallback/retry behavior remains intact.
Blast Radius
Python SDK only: sdks/python/pmxt/client.py and sdks/python/pmxt/server_manager.py. No core exchange behavior, OpenAPI schema, generated SDK code, or venue API calls are changed.
Consumer Verification
Before (base branch):
The affected paths swallowed failures, for example malformed resolutionDate parsing did except ValueError: pass, and sidecar restart/cleanup failures did except Exception/OSError: pass. A consumer would receive no diagnostic even though the fallback path was taken.
After (PR branch):
Static/compile verification confirms those same paths now call warnings.warn(..., RuntimeWarning, stacklevel=2) while preserving control flow. The changed files compile successfully:
python3 -m compileall -q sdks/python/pmxt/client.py sdks/python/pmxt/server_manager.py
compileall:0
Example changed behavior:
warnings.warn( f"Ignoring malformed resolutionDate {res_date_raw!r}: {exc}", RuntimeWarning, stacklevel=2, )
Test Results
- Build: PASS (
npm run build --workspace=pmxt-core) - Unit tests: NOT VERIFIED (no dedicated Python warning tests were run in this runner)
- Server starts: N/A (Python SDK diagnostics-only change)
- E2E smoke: PASS for syntax/compile of the changed Python modules; runtime warning paths not fully exercised end-to-end
Findings
No blocking findings.
PMXT Pipeline Check
- Field propagation (3-layer): N/A
- OpenAPI sync: N/A
- Financial precision: N/A
- Type safety: OK
- Auth safety: OK — warning strings do not include credentials; they include malformed dates, PIDs, lock path, or exception text from local sidecar cleanup.
Semver Impact
patch -- diagnostics-only bug fix with no public API or response-shape change.
Risk
This is not marked VERIFIED because I did not run a dedicated Python test suite that asserts the warnings are emitted. One behavioral nuance: warning on OSError during process termination may also surface benign stale-PID races, but that matches the PR's stated goal of replacing silent cleanup failures with diagnostics.
Summary
RuntimeWarningdiagnostics while preserving existing fallback behavior.Fixes #1107
Fixes #1108
Fixes #1109
Fixes #1110
Test Plan
python3 -m compileall -q sdks/python/pmxt/client.py sdks/python/pmxt/server_manager.pygit diff --checkuv run --no-project --with pytest --with pytest-asyncio python -m pytest tests/test_client_startup.py tests/test_converters.py -q(blocked because this checkout does not include/generatedpmxt_internal, so tests fail during import before exercising the changed code)