fix: a thread the system refuses ends its job with an error, not the app; lint the rules #2752
All Vouch review confidence checks passed
Residual risk 0.38 = Change Risk (0.48) × (1 − Review Confidence (0.22)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 546 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 33% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.377
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #2752"
general
weight: 0.35
github-actions[bot]
Summary
AGENTS.md › "Use the threads" says the thread count comes from
rustgis_data::threads, neveravailable_parallelism, and that a thread the system refuses costs speed, not the run.std::thread::spawnbreaks the second rule: it panics when the system refuses a thread, which takes the app down with it.clippy.tomlnow refuses bothstd::thread::available_parallelismandstd::thread::spawn, in the samedisallowed-methodslist as the spherical measures (#2730). A remaining use says why in its#[expect(clippy::disallowed_methods, reason = "…")].Every non-test
std::thread::spawnnow usesstd::thread::Builderand handles a refusal, in whatever way the surrounding code already ends a failed job:| Site | What a refused thread does now |
|---|---|
|
ui-egui/src/layerchooser.rsadd_file| the file is added as when its layers can't be listed, through the newwork_off_frame||
ui-egui:repairsource::list_datasets,sqlpane(preview, names, run),update::install::start,pluginsui::fetch,assistantpane::dispatch,assistantpane::revoke_later| the job's slot gets the refusal as its error, through the newwork_off_frame, and the pane shows it as it shows any failure ||
ui-egui/src/pluginsui.rsprepare_env| the environment job ends with the refusal as its error ||
ui-egui/src/assistantpane.rsread_sign_in| the sign-in stays as it is (not read is not signed out), and the refusal is said as a sign-in store error ||
ui-egui/src/localagents.rsRun::start(input, errors, output) |startreturns the refusal, and dropping the run stops the agent's program, as when its first message can't be sent ||
assistant/src/chatgpt.rslogin_inner,cancellable| the sign-in returns the refusal as its error ||
tiles/src/arcgis_auth.rsstart_sign_in| the sign-in fails with the refusal, in its progress and its result ||
tiles/src/arcgis_auth.rsrevoke_all| the revocations go unsent, as when a request fails (it was already best effort) ||
tiles/src/cache.rshead,post_fetched,download_fetched_within,download_fetched_public_within| the request'sdonehears the refusal as its error (a HEAD reads the file without asking, as past its limit), through the newanswer_on_own_thread, which keepsdonereachable when the thread never starts ||
data/src/source/external.rsrun,geolibre/src/runner.rsoutput_until,plugins/src/pyenv.rsrun_uv| the program is stopped and the refusal is the error, asexternal::runalready did without a thread to write its input with ||
plugins/src/process.rsspawn(lines,errors,writer) | the plugin's program is stopped andspawnreturns the refusal, as when its pipes can't be connected |available_parallelismstays in one place,rustgis_data::threads::cores, with its reason. Tests keepstd::thread::spawn, under one#[expect]per test module or file: there, a refused thread fails the test, as it should. No site needed a design decision. There is no new dependency, and nothing changes while the system grants threads.AGENTS.md› "Use the threads" now says the lint enforces these rules.Surfaces: the desktop app, and the command line and Python through the data, plugins, GeoLibre, tiles and Assistant crates. In the browser,
Builder::spawnreturns an error wherestd::thread::spawnpanicked, but none of these paths runs there. The ribbon, the saved project and the command ids are unchanged.Testing
let _ = std::thread::spawn(|| ()).join();andlet _ = std::thread::available_parallelism();added togeolibre::runner::output_until,cargo clippy -p rustgis-geolibre -- -D warningsfails twice. It gives `use of a disallowed methodstd::thread::spawnwith the note "it panics when the system refuses a thread: usestd::thread::Builder::spawnand handle the error", anduse of a disallowed methodstd::thread::available_parallelismwith its note.Related issue
None: this enforces AGENTS.md › "Use the threads".