Skip to content

ADFA-4896 fix(dashboard): maps stop/cancel actually stop the extract - #456

Merged
luisguzman-adfa merged 4 commits into
mainfrom
fix/ADFA-4896-maps-stop-cancel
Aug 21, 2026
Merged

luisguzman-adfa merged 4 commits into
mainfrom
fix/ADFA-4896-maps-stop-cancel

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

The maps runner shelled through sudo, so pause/cancel only killed the sudo wrapper -- the tile-extract.py worker was reparented, ran to completion in the background, and the region ended up listed even after cancel; pause "resumed" on its own for the same reason.

  • Engine: kill the whole process group (killAll, negative-pid SIGKILL) so a runner's detached wrapper takes its worker down with it; drop late ctx.update() once a job is paused/canceled so a slow-dying line can't resurrect the phase.
  • maps runner: spawn the extract detached; honor pause vs cancel via classifyStop; purge the partial (tile-extract.py delete + update-json) on any non-success. Pause is stop+restart (resume re-extracts clean); cancel removes the region entirely. No maps per-layer checkpoint yet (ADFA-4898).
  • Bump dashboard 1.2.5-dev.1 + CHANGELOG; add an engine test that a stopped job ignores late updates.

The maps runner shelled through `sudo`, so pause/cancel only killed the sudo
wrapper -- the tile-extract.py worker was reparented, ran to completion in the
background, and the region ended up listed even after cancel; pause "resumed"
on its own for the same reason.

- Engine: kill the whole process group (killAll, negative-pid SIGKILL) so a
  runner's detached wrapper takes its worker down with it; drop late ctx.update()
  once a job is paused/canceled so a slow-dying line can't resurrect the phase.
- maps runner: spawn the extract detached; honor pause vs cancel via
  classifyStop; purge the partial (tile-extract.py delete + update-json) on any
  non-success. Pause is stop+restart (resume re-extracts clean); cancel removes
  the region entirely. No maps per-layer checkpoint yet (ADFA-4898).
- Bump dashboard 1.2.5-dev.1 + CHANGELOG; add an engine test that a stopped job
  ignores late updates.
Confirmed against the upstream script (iiab/iiab maps role): tile-extract.py
extracts each pmtiles into /library/downloads/maps and only shutil.move()s all
three into the served dir once they ALL finish (updating extracts.json last),
and its own `delete` cleans ONLY the served dir. So a killed extract left
half-written pmtiles in TMP_DIR that `delete` never removes.

purgeRegion now prunes `*.full-region.<name>.pmtiles` from TMP_DIR (name-scoped,
so a concurrent extract is untouched) in addition to `delete` (kept for the rare
race where the extract finished just as the stop landed; it refreshes
extracts.json itself). Forward fix over the previous commit, not a rewrite.
… Stop)

Code-review follow-up: cancel() only marked ACTIVE jobs 'canceled', so canceling
a paused job (Cancel after Stop) left it stuck at 'paused' forever -- its runner
had already exited, so there was no rt to kill and the phase guard skipped it.
cancel() now finalizes 'paused' -> 'canceled' too. For maps the partial was
already purged at pause time, so nothing lingers. Adds an engine test; bumps
1.2.5-dev.2.
Strip the -dev suffix now that the branch is device-verified on the box (all four
behavioral checks + 5/5 engine tests; group-kill confirmed to reach the pmtiles
worker under proot -- no background survivor). CHANGELOG heading 1.2.5-dev -> 1.2.5.
@luisguzman-adfa
luisguzman-adfa merged commit 604b003 into main Aug 21, 2026
4 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/ADFA-4896-maps-stop-cancel branch August 21, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant