Repository navigation
fix(data): a stop reaches a Rust step that runs - #2727
Merged
Merged
Conversation
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>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
…uss-45af60 # Conflicts: # host/obc-pack/src/landmarks/mod.rs # host/obc-pack/src/landmarks/peaks.rs # host/obc-pack/src/landmarks/shared.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A run checks for a stop only before its next fetch, step or phase. A Rust step (
Run::Rust, for exampledevice/landmark-contentanddevice/peak-content) runs in theobc-dataprocess 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 untilobc data unlock.Change
Run::buildhas 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_processputs the flag in a thread-local of the step thread, next toCHILDREN.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.check_stop():shared::facts,view,peak_view,bundles, the class and place loops oflandmarks::compile_selected, and the summit and entity loops ofpeaks::compile.the run stopped. The run then endsstoppedand frees its lock, the same as a stop between steps.A step program already stops:
stopsends 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.pbfdiscovery passes (ElementReader::for_each) cannot break out early. They are one linear pass. Theobc-drawandobc-networksteps still make aCancelTokenthat nothing cancels. Linking that token to this flag is a possible follow-up.Tests
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 oncheck_stop(). The test asserts that the run fails in less than 10 s withstep \test/long`: the run stopped, and that its state isstopped`.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_nothingfailed locally because the worktree has nobuilder/webNode 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 nextcheck_stop. Public docs did not change.Requirements: none
🤖 Generated with Claude Code