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:57017
import { MongoClient } from "mongodb";
const client = new MongoClient("mongodb://127.0.0.1:57017/?directConnection=true");
await client.connect();
const col = client.db("pkgbench").collection("items_if");
await col.deleteMany({});
const once = async (i: number) => {
await col.insertOne({ _id: "d" + i, n: i } as any);
return (await col.findOne({ _id: "d" + i } as any)) as any;
};
for (let i = 0; i < 200; i++) await once(i); // "warm-up"
await col.deleteMany({});
for (let i = 0; i < 500; i++) await once(i); // perry: rejects here
await col.drop(); await client.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).
Found by the Phase 1 package benchmark harness (
benchmarks/packages/mongodb/insert_find.ts, branchwip/pkg-bench-phase1). Reproduces on main36420d2e56(Linux x86-64, mongod 8.x, mongodb 7.6.0 compiled from source).Sequential
insertOne+findOneround trips work for hundreds of iterations, but after adeleteMany({})on the same collection, the nextinsertOnerejects withCannot 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):Measured with the workload binary (
./mongodb__insert_find <n> <warm>):500 0(no warm-up, so no mid-run deleteMany)500 200ERROR Cannot read properties of undefined (reading 'state'), then no exit (killed at 120 s)2000 200The companion workload
mongodb/batch_query(insertMany+find().sort().project().toArray()+countDocuments, also with a mid-rundeleteMany) runs correctly on the same server. Distinct from #11043 (reading 'default'on connect). The harness now skips this workload as a known hang (manifestknown_hang).