{"record":{"id":"385e1ac4d9a08e83","repo":"GitoxideLabs/gitoxide","slug":"interrupted-by-user","errorCode":null,"errorMessage":"interrupted by user","messagePattern":"interrupted by user","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"gitoxide-core/src/corpus/engine.rs","lineNumber":118,"sourceCode":"                        repo_progress.inc();\n                    }\n                    repo_progress.info(format!(\"with {} tasks\", tasks.len()));\n                    for (_, task) in tasks {\n                        repo_progress.info(format!(\"task '{}' ({})\", task.description, task.short_name));\n                    }\n                    break 'tasks_loop;\n                }\n                let mut run_progress = repo_progress.add_child(\"set later\");\n                let (_guard, current_id) = corpus::trace::override_thread_subscriber(\n                    db_path.as_str(),\n                    self.state.trace_to_progress.then(|| repo_progress.add_child(\"trace\")),\n                    self.state.reverse_trace_lines,\n                )?;\n\n                let mut num_errors = 0;\n                for repo in &repos {\n                    if gix::interrupt::is_triggered() {\n                        bail!(\"interrupted by user\");\n                    }\n                    run_progress.set_name(format!(\n                        \"{}\",\n                        repo.path\n                            .strip_prefix(corpus_path)\n                            .expect(\"corpus contains repo\")\n                            .display()\n                    ));\n\n                    // TODO: wait for new release of `tracing-forest` to be able to provide run_id via span attributes\n                    let mut run = Self::insert_run(&self.con, gitoxide_id, runner_id, *task_id, repo.id)?;\n                    current_id.store(run.id, Ordering::SeqCst);\n                    tracing::info_span!(\"run\", run_id = run.id).in_scope(|| {\n                        task.perform(\n                            &mut run,\n                            &repo.path,\n                            &mut run_progress,\n                            Some(threads),","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/corpus/engine.rs#L100-L136","documentation":"During `perform_run`, before each repository in the corpus is processed the engine checks `gix::interrupt::is_triggered()` (SIGINT/Ctrl-C flag). If an interrupt signal was received, it aborts the whole run with this bail so the process exits with a clear error instead of being killed mid-write.","triggerScenarios":"Pressing Ctrl-C (or sending SIGINT) to the process while `Engine::perform_run` is iterating over corpus repositories, causing the `gix::interrupt` handler flag to be set before the next repo begins.","commonSituations":"A developer realizes a corpus run over hundreds of repos is taking too long and hits Ctrl-C; a CI job is cancelled and the harness sends SIGINT; a user interrupts after seeing bad progress output.","solutions":["This is expected on user interruption — no fix needed; re-run the command without sending a signal.","If interruption happens unintentionally, check terminal/CI signal forwarding (e.g. CI cancellation, `timeout` commands).","For long runs, restrict the corpus with a repo SQL suffix or fewer tasks so runs finish before you need to interrupt.","Handle the resulting `anyhow` error gracefully in scripts by checking for the 'interrupted by user' message."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match res {\n    Err(e) if e.to_string() == \"interrupted by user\" => {\n        eprintln!(\"run cancelled; partial results kept\");\n    }\n    other => other?,\n}","preventionTips":["Don't send SIGINT unless you intend to abort the corpus run.","Check CI cancellation semantics if runs are aborted unexpectedly.","Plan long runs with a repo SQL suffix or task filter to shorten duration.","Persist progress so interrupted runs can resume cheaply."],"tags":["interrupt","sigint","cancellation","cli"],"backgroundTag":"user-interrupt","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}