Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions src/mcp/mcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -7607,13 +7607,29 @@ static char *index_run_supervised(cbm_mcp_server_t *srv, const char *args) {
cbm_index_worker_result_free(&wr2);
break; /* good files indexed; quarantined files reported as crash/hang */
}
if (wr2.outcome == CBM_PROC_CRASH || wr2.outcome == CBM_PROC_HANG) {
if (wr2.outcome == CBM_PROC_CRASH || wr2.outcome == CBM_PROC_HANG ||
wr2.outcome == CBM_PROC_EXIT_NONZERO) {
last_outcome = wr2.outcome;
cbm_index_worker_result_free(&wr2);
/* crash vs hang: the phase this file is quarantined under and
* reported as in skipped[]. A fault signal → "crash"; a
* no-progress kill → "hang". */
const char *phase = (last_outcome == CBM_PROC_HANG) ? "hang" : "crash";
/* crash vs hang vs nonzero-exit: the phase this file is quarantined
* under and reported as in skipped[]. A fault signal → "crash"; a
* no-progress kill → "hang"; a graceful nonzero exit (e.g. an
* internal parse-limit/abort on a pathological file) → "error".
* EXIT_NONZERO is attributed via the SAME marker-journal suspect
* mechanism as a crash: the two-consecutive-strikes intersection
* below still guards against quarantining an innocent file, and a
* SYSTEMIC nonzero exit (e.g. a bad arg) produces no recurring
* suspect → the intersection is empty → give_up (correct). This
* makes a single pathological file skip-and-continue instead of
* aborting the whole chunk. */
const char *phase;
if (last_outcome == CBM_PROC_HANG) {
phase = "hang";
} else if (last_outcome == CBM_PROC_EXIT_NONZERO) {
phase = "error";
} else {
phase = "crash";
}
int sus_n = 0;
char **suspects = supervisor_read_suspects(marker_path, &sus_n);
(void)remove(marker_path); /* fresh journal for the next re-run */
Expand Down
5 changes: 3 additions & 2 deletions src/pipeline/pass_definitions.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,9 @@ int cbm_pipeline_pass_definitions(cbm_pipeline_ctx_t *ctx, const cbm_file_info_t
if (!phase) {
phase = "crash";
}
const char *reason =
(strcmp(phase, "hang") == 0) ? "quarantined after hang" : "quarantined after crash";
const char *reason = (strcmp(phase, "hang") == 0) ? "quarantined after hang"
: (strcmp(phase, "error") == 0) ? "quarantined after error"
: "quarantined after crash";
cbm_pipeline_add_file_error(ctx->pipeline, rel, reason, phase);
errors++;
continue;
Expand Down
5 changes: 3 additions & 2 deletions src/pipeline/pass_parallel.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,9 @@ static void extract_worker(int worker_id, void *ctx_ptr) {
if (!phase) {
phase = "crash";
}
const char *reason =
(strcmp(phase, "hang") == 0) ? "quarantined after hang" : "quarantined after crash";
const char *reason = (strcmp(phase, "hang") == 0) ? "quarantined after hang"
: (strcmp(phase, "error") == 0) ? "quarantined after error"
: "quarantined after crash";
pp_err_add(errs, fi->rel_path, reason, phase);
ws->errors++;
continue;
Expand Down
Loading