You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mongodb 7.6.0: insertOne after deleteMany rejects with "reading 'state'" and the process hangs #11460
Found by the Phase 1 package benchmark harness (benchmarks/packages/mongodb/insert_find.ts, branch wip/pkg-bench-phase1). Reproduces on main 36420d2e56 (Linux x86-64, mongod 8.x, mongodb 7.6.0 compiled from source).
Sequential insertOne + findOne round trips work for hundreds of iterations, but after a deleteMany({}) on the same collection, the next insertOne rejects with Cannot read properties of undefined (reading 'state'), and the process then hangs (never exits) instead of finishing. The workload's shape (the numbers below are from the workload binary itself, not from this condensed snippet):
// npm i mongodb@7.6.0 ; mongod on 127.0.0.1:57017import{MongoClient}from"mongodb";constclient=newMongoClient("mongodb://127.0.0.1:57017/?directConnection=true");awaitclient.connect();constcol=client.db("pkgbench").collection("items_if");awaitcol.deleteMany({});constonce=async(i: number)=>{awaitcol.insertOne({_id: "d"+i,n: i}asany);return(awaitcol.findOne({_id: "d"+i}asany))asany;};for(leti=0;i<200;i++)awaitonce(i);// "warm-up"awaitcol.deleteMany({});for(leti=0;i<500;i++)awaitonce(i);// perry: rejects hereawaitcol.drop();awaitclient.close();console.log("done");
Measured with the workload binary (./mongodb__insert_find <n> <warm>):
args
perry (main)
node 26.5.1
500 0 (no warm-up, so no mid-run deleteMany)
correct checksum, 12 s
same checksum
500 200
ERROR Cannot read properties of undefined (reading 'state'), then no exit (killed at 120 s)
correct
2000 200
no output, killed at 120 s
correct
The companion workload mongodb/batch_query (insertMany + find().sort().project().toArray() + countDocuments, also with a mid-run deleteMany) runs correctly on the same server. Distinct from #11043 (reading 'default' on connect). The harness now skips this workload as a known hang (manifest known_hang).
The package matrix re-run (#11723) at 9e29f59 found that mongodb/insert_find now runs correctly and no longer hangs. It is 222× Node on instructions and peaks at 1,185 MB vs Node's 115 MB. Can this issue be closed as fixed? The perf gap is tracked separately.
The package matrix re-run (#11723) found mongodb insert_find now runs correctly and no longer hangs. The remaining gap is performance and memory, which is tracked separately.
Activity
proggeramlug commentedon Oct 1, 2026
The package matrix re-run (#11723) at 9e29f59 found that mongodb/insert_find now runs correctly and no longer hangs. It is 222× Node on instructions and peaks at 1,185 MB vs Node's 115 MB. Can this issue be closed as fixed? The perf gap is tracked separately.
proggeramlug commentedon Oct 12, 2026
The package matrix re-run (#11723) found mongodb insert_find now runs correctly and no longer hangs. The remaining gap is performance and memory, which is tracked separately.