mongodb 6.18.0-dev.20250806.sha.e628296a → 6.18.0-dev.20250814.sha.33d340ef
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/collection.js +5 -5
- package/lib/collection.js.map +1 -1
- package/lib/operations/client_bulk_write/client_bulk_write.js +9 -42
- package/lib/operations/client_bulk_write/client_bulk_write.js.map +1 -1
- package/lib/operations/count.js +8 -4
- package/lib/operations/count.js.map +1 -1
- package/lib/operations/create_collection.js +17 -20
- package/lib/operations/create_collection.js.map +1 -1
- package/lib/operations/delete.js +16 -13
- package/lib/operations/delete.js.map +1 -1
- package/lib/operations/drop.js +13 -6
- package/lib/operations/drop.js.map +1 -1
- package/lib/operations/estimated_document_count.js +8 -4
- package/lib/operations/estimated_document_count.js.map +1 -1
- package/lib/operations/execute_operation.js.map +1 -1
- package/lib/operations/find_and_modify.js +53 -42
- package/lib/operations/find_and_modify.js.map +1 -1
- package/lib/operations/indexes.js +16 -11
- package/lib/operations/indexes.js.map +1 -1
- package/lib/operations/insert.js +0 -13
- package/lib/operations/insert.js.map +1 -1
- package/lib/operations/list_databases.js +6 -4
- package/lib/operations/list_databases.js.map +1 -1
- package/lib/operations/rename.js +11 -9
- package/lib/operations/rename.js.map +1 -1
- package/lib/operations/search_indexes/create.js +12 -9
- package/lib/operations/search_indexes/create.js.map +1 -1
- package/lib/operations/search_indexes/update.js +12 -5
- package/lib/operations/search_indexes/update.js.map +1 -1
- package/lib/operations/update.js +23 -20
- package/lib/operations/update.js.map +1 -1
- package/lib/operations/validate_collection.js +18 -19
- package/lib/operations/validate_collection.js.map +1 -1
- package/lib/sdam/server.js +25 -15
- package/lib/sdam/server.js.map +1 -1
- package/package.json +1 -1
- package/src/collection.ts +7 -22
- package/src/operations/client_bulk_write/client_bulk_write.ts +23 -67
- package/src/operations/count.ts +11 -11
- package/src/operations/create_collection.ts +22 -31
- package/src/operations/delete.ts +32 -36
- package/src/operations/drop.ts +18 -17
- package/src/operations/estimated_document_count.ts +10 -11
- package/src/operations/execute_operation.ts +7 -6
- package/src/operations/find_and_modify.ts +80 -56
- package/src/operations/indexes.ts +17 -26
- package/src/operations/insert.ts +0 -20
- package/src/operations/list_databases.ts +8 -17
- package/src/operations/rename.ts +13 -16
- package/src/operations/search_indexes/create.ts +16 -16
- package/src/operations/search_indexes/update.ts +16 -11
- package/src/operations/update.ts +55 -54
- package/src/operations/validate_collection.ts +21 -29
- package/src/sdam/server.ts +25 -15
package/src/sdam/server.ts
CHANGED
|
@@ -303,7 +303,30 @@ export class Server extends TypedEventEmitter<ServerEvents> {
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
|
|
306
|
+
let reauthPromise: Promise<void> | null = null;
|
|
307
|
+
const cleanup = () => {
|
|
308
|
+
this.decrementOperationCount();
|
|
309
|
+
if (session?.pinnedConnection !== conn) {
|
|
310
|
+
if (reauthPromise != null) {
|
|
311
|
+
// The reauth promise only exists if it hasn't thrown.
|
|
312
|
+
const checkBackIn = () => {
|
|
313
|
+
this.pool.checkIn(conn);
|
|
314
|
+
};
|
|
315
|
+
void reauthPromise.then(checkBackIn, checkBackIn);
|
|
316
|
+
} else {
|
|
317
|
+
this.pool.checkIn(conn);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
let cmd;
|
|
323
|
+
try {
|
|
324
|
+
cmd = operation.buildCommand(conn, session);
|
|
325
|
+
} catch (e) {
|
|
326
|
+
cleanup();
|
|
327
|
+
throw e;
|
|
328
|
+
}
|
|
329
|
+
|
|
307
330
|
const options = operation.buildOptions(timeoutContext);
|
|
308
331
|
const ns = operation.ns;
|
|
309
332
|
|
|
@@ -325,8 +348,6 @@ export class Server extends TypedEventEmitter<ServerEvents> {
|
|
|
325
348
|
options.omitMaxTimeMS = true;
|
|
326
349
|
}
|
|
327
350
|
|
|
328
|
-
let reauthPromise: Promise<void> | null = null;
|
|
329
|
-
|
|
330
351
|
try {
|
|
331
352
|
try {
|
|
332
353
|
const res = await conn.command(ns, cmd, options, operation.SERVER_COMMAND_RESPONSE_TYPE);
|
|
@@ -360,18 +381,7 @@ export class Server extends TypedEventEmitter<ServerEvents> {
|
|
|
360
381
|
throw operationError;
|
|
361
382
|
}
|
|
362
383
|
} finally {
|
|
363
|
-
|
|
364
|
-
if (session?.pinnedConnection !== conn) {
|
|
365
|
-
if (reauthPromise != null) {
|
|
366
|
-
// The reauth promise only exists if it hasn't thrown.
|
|
367
|
-
const checkBackIn = () => {
|
|
368
|
-
this.pool.checkIn(conn);
|
|
369
|
-
};
|
|
370
|
-
void reauthPromise.then(checkBackIn, checkBackIn);
|
|
371
|
-
} else {
|
|
372
|
-
this.pool.checkIn(conn);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
384
|
+
cleanup();
|
|
375
385
|
}
|
|
376
386
|
}
|
|
377
387
|
|