mirror of https://github.com/mongodb/mongo
SERVER-112231 Fix race condition when stopping MockOCSPServer (#43417)
GitOrigin-RevId: 6ac97dcce946c4d93f72e61eafd112af8fded423
This commit is contained in:
parent
f3892f1d3a
commit
add4533c77
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue