SERVER-112231 Fix race condition when stopping MockOCSPServer (#43417)

GitOrigin-RevId: 6ac97dcce946c4d93f72e61eafd112af8fded423
This commit is contained in:
adriangzz 2025-11-03 18:04:08 -06:00 committed by MongoDB Bot
parent f3892f1d3a
commit add4533c77
1 changed files with 12 additions and 0 deletions

View File

@ -152,6 +152,18 @@ export class MockOCSPServer {
} else {
const kSIGINT = 2;
stopMongoProgramByPid(this.pid, kSIGINT);
for (let i = 0; i < 50; i++) {
if (!checkProgram(this.pid).alive) {
print("Mock OCSP Server stop complete");
return;
}
sleep(100);
}
// Mock could be caught in a hang, force terminate it
const kSIGKILL = 9;
stopMongoProgramByPid(this.pid, kSIGKILL);
}
print("Mock OCSP Server stop complete");