[SERVER-79662] Track open threads and parallel shells for diagnostics on shutdown Created: 03/Aug/23  Updated: 10/Oct/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Matt Broadstone Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: make-server-testing-joyful
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Service Arch
Participants:

 Description   

Today this code will crash the shell with what appears to be undefined behavior

load('jstests/libs/parallelTester.js');
var a = fork(function(a, b) {
    return a / b;
}, 10, 2);
a.start();

If you run the snippet in gdb, it will show you that we're calling terminate() because the std::thread was never joined. We can provided an easier-to-debug experience for developers by tracking thread creation ourselves, and checking for open threads (and their source location) on shutdown of the test runner.


Generated at Thu Feb 08 06:41:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.