@@ -2,6 +2,7 @@ import { MongoClientBulkWriteExecutionError, ServerType } from '../../beta';
22import { ClientBulkWriteCursorResponse } from '../../cmap/wire_protocol/responses' ;
33import type { Server } from '../../sdam/server' ;
44import type { ClientSession } from '../../sessions' ;
5+ import { type TimeoutContext } from '../../timeout' ;
56import { MongoDBNamespace } from '../../utils' ;
67import { CommandOperation } from '../command' ;
78import { Aspect , defineAspects } from '../operation' ;
@@ -35,14 +36,15 @@ export class ClientBulkWriteOperation extends CommandOperation<ClientBulkWriteCu
3536 */
3637 override async execute (
3738 server : Server ,
38- session : ClientSession | undefined
39+ session : ClientSession | undefined ,
40+ timeoutContext : TimeoutContext
3941 ) : Promise < ClientBulkWriteCursorResponse > {
4042 let command ;
4143
4244 if ( server . description . type === ServerType . LoadBalancer ) {
4345 if ( session ) {
4446 // Checkout a connection to build the command.
45- const connection = await server . pool . checkOut ( ) ;
47+ const connection = await server . pool . checkOut ( { timeoutContext } ) ;
4648 // Pin the connection to the session so it get used to execute the command and we do not
4749 // perform a double check-in/check-out.
4850 session . pin ( connection ) ;
@@ -69,7 +71,13 @@ export class ClientBulkWriteOperation extends CommandOperation<ClientBulkWriteCu
6971 server . description . maxWriteBatchSize
7072 ) ;
7173 }
72- return await super . executeCommand ( server , session , command , ClientBulkWriteCursorResponse ) ;
74+ return await super . executeCommand (
75+ server ,
76+ session ,
77+ command ,
78+ timeoutContext ,
79+ ClientBulkWriteCursorResponse
80+ ) ;
7381 }
7482}
7583
0 commit comments