Skip to content

Commit ce23ce7

Browse files
authored
Merge pull request #925 from DeusData/fix/idx832-worker-lsan-exit
fix(test): harness index worker must _Exit like the production worker
2 parents 1c1b6df + 40d8294 commit ce23ce7

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

tests/test_main.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,18 @@ static int tf_maybe_run_index_worker(int argc, char **argv) {
7575
(void)fclose(rf);
7676
}
7777
}
78-
free(result);
7978
}
80-
cbm_mcp_server_free(srv);
81-
return 0;
79+
/* Faithful worker exit: mirror run_cli's supervised-worker fast path.
80+
* The worker-role pipeline deliberately skips its teardown (the OS
81+
* reclaims everything wholesale on process death), so a normal return
82+
* through main() lets LeakSanitizer run at exit, report the
83+
* intentionally-unfreed pipeline, and force exit code 1 — the
84+
* supervisor then reads a HEALTHY index as worker_failed (the
85+
* Linux-only IDX832 red: LSan is active in Linux gcc ASan builds,
86+
* absent on macOS/Windows). _Exit skips atexit/LSan by design,
87+
* exactly like the production worker in run_cli. */
88+
fflush(NULL);
89+
_Exit(result ? 0 : 1);
8290
}
8391

8492
/* #798 follow-up: socket-isolation probe. The parent test

0 commit comments

Comments
 (0)