Skip to content

fix(data): a stop reaches a Rust step that runs - #2727

Merged
timohueser merged 2 commits into
developfrom
claude/friendly-gauss-45af60
Oct 18, 2026
Merged

timohueser merged 2 commits into
developfrom
claude/friendly-gauss-45af60

Conversation

@timohueser

Copy link
Copy Markdown
Owner

Problem

A run checks for a stop only before its next fetch, step or phase. A Rust step (Run::Rust, for example device/landmark-content and device/peak-content) runs in the obc-data process and does not see the stop. A DACH bake stayed in such a step for more than 20 minutes after Stop. Only a second SIGTERM ended it, and the lock of the target stayed held until obc data unlock.

Change

  • Run::build has one stop flag for its steps. When the build loop wakes, it sets the flag if the run stops: on a signal, on the stop file, or when another run takes the lock. The loop wakes at least once per second.
  • process::in_process puts the flag in a thread-local of the step thread, next to CHILDREN. obc_data::engine::check_stop() fails once the flag is set. Outside a step it never fails, so the CLI paths of the compilers do not change.
  • The per-item loops of the landmark and peak content steps call check_stop(): shared::facts, view, peak_view, bundles, the class and place loops of landmarks::compile_selected, and the summit and entity loops of peaks::compile.
  • The step fails with the run stopped. The run then ends stopped and frees its lock, the same as a stop between steps.

A step program already stops: stop sends SIGTERM to the process group of the run. So a child process for Rust steps adds nothing that this change does not do.

Not covered: the .osm.pbf discovery passes (ElementReader::for_each) cannot break out early. They are one linear pass. The obc-draw and obc-network steps still make a CancelToken that nothing cancels. Linking that token to this flag is a possible follow-up.

Tests

  • New: engine::runs::tests::a_stop_during_a_rust_step_ends_the_step_and_the_run_as_stopped. A Rust step writes the stop file of its run and loops on check_stop(). The test asserts that the run fails in less than 10 s with step \test/long`: the run stopped, and that its state is stopped`.
  • obc test -p obc-data: 197 passed. obc test -p obc-pack: 95 passed.
  • cargo clippy -p obc-data -p obc-pack --all-targets -- -D warnings: clean. cargo fmt --all, obc suites check, obc prose --check: OK.
  • obc ready --base origin/develop: 3211 of 3212 passed. obc-data-steps::planner_build::a_build_makes_the_routing_package_and_its_overlays_and_a_second_plan_builds_nothing failed locally because the worktree has no builder/web Node modules (Cannot find module '@mapbox/vector-tile'). This change does not touch that path. CI is the gate.

Docs

The contract specs/obc-data.md (runs/<id>/stop) adds one sentence: a step program ends on the signal, and a Rust step fails within seconds at its next check_stop. Public docs did not change.

Requirements: none

🤖 Generated with Claude Code

A run checked for a stop only before its next fetch, step or phase. A
Rust step, such as device/landmark-content, ran in the process and did
not see a stop. Only a second signal ended it, and the lock of the
target stayed held.

The build loop now sets a flag of the run when it sees a stop, at most
one second after it. `in_process` gives the flag to the step thread,
and `engine::check_stop` fails once it is set. The landmark and peak
content loops call it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c18435a5-6157-4b65-a514-7d59561457f6
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…uss-45af60

# Conflicts:
#	host/obc-pack/src/landmarks/mod.rs
#	host/obc-pack/src/landmarks/peaks.rs
#	host/obc-pack/src/landmarks/shared.rs
@timohueser
timohueser merged commit dfdc377 into develop Oct 18, 2026
30 checks passed
@timohueser
timohueser deleted the claude/friendly-gauss-45af60 branch October 18, 2026 14:43
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