Cancellation latency regression in /v1/digitize (2.04s vs 2.0s budget) #126
Labels
No labels
blocked:children
blocked:depends-101
blocked:depends-103
blocked:depends-104
blocked:needs-attention
blocked:needs-decision
blocked:no-changes
blocked:preflight
bug
chore
feature-request
in-progress
lint-cleanup
needs-decompose
performance
quality
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/easystitch#126
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Cancellation latency regression in /v1/digitize
Repo: Mark/easystitch
Severity: Low (test-only regression, but deterministic)
Found: 2026-09-08 full shakedown
Symptom
tests/test_service_digitize.py::test_digitize_cancellation_on_disconnect_returns_within_one_secondasserts cancellation returns within 2.0s. It now consistently takes 2.04–2.05s — 40–50ms
over budget, every run, not flaky.
Test budget comment (line 167):
Budget: 50 ms poll cadence + stage-boundary check + buffer.Why it matters
This is the contract that
/v1/digitizecancels a running pipeline when the HTTP clientdisconnects. Slow cancellation ties up a thread-pool slot for an extra second per abandoned
request — at 5 concurrent digitizes on a 4-core box, that's a 25% utilization loss under
flaky-client conditions.
Likely location
pipeline_runner.py— the cancellation check loop's poll intervalmain_pipeline.py— the cancel_event check inside the engine's stage loopAcceptance
test_digitize_cancellation_on_disconnect_returns_within_one_secondpasses