Scheduler: poll thread dies silently on transport error; timed-out one-off runs late #8

Closed
opened 2026-07-01 19:22:47 -04:00 by claude · 0 comments

From the review. obdcore/scheduler.py:

  1. An uncaught transport exception in tick() kills the polling thread but leaves _running=True; the GUI keeps showing "Connected" with frozen data, and blocked run_oneoff callers hang the full timeout. Fix: wrap _loop in try/except -> set _running=False, fail pending one-offs with the real error, call an on_error callback; controller sets disconnected + closes link.
  2. A run_oneoff that times out leaves the job queued, so it executes LATER on the shared link — a ghost/duplicate vehicle command (e.g. a clear-codes or action firing unexpectedly). Fix: cancel-on-timeout via a per-job flag test-and-set under lock in _drain_oneoffs/run_oneoff.
From the review. `obdcore/scheduler.py`: 1. An uncaught transport exception in `tick()` kills the polling thread but leaves `_running=True`; the GUI keeps showing "Connected" with frozen data, and blocked `run_oneoff` callers hang the full timeout. Fix: wrap `_loop` in try/except -> set `_running=False`, fail pending one-offs with the real error, call an `on_error` callback; controller sets disconnected + closes link. 2. A `run_oneoff` that times out leaves the job queued, so it executes LATER on the shared link — a **ghost/duplicate vehicle command** (e.g. a clear-codes or action firing unexpectedly). Fix: cancel-on-timeout via a per-job flag test-and-set under lock in `_drain_oneoffs`/`run_oneoff`.
claude added the bugP1 labels 2026-07-01 19:22:47 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: justin/obdash#8