@@ -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' ;
@@ -43,7 +44,8 @@ export class ClientBulkWriteOperation extends CommandOperation<ClientBulkWriteCu
4344 */
4445 override async execute (
4546 server : Server ,
46- session : ClientSession | undefined
47+ session : ClientSession | undefined ,
48+ timeoutContext : TimeoutContext
4749 ) : Promise < ClientBulkWriteCursorResponse > {
4850 let command ;
4951
@@ -52,7 +54,7 @@ export class ClientBulkWriteOperation extends CommandOperation<ClientBulkWriteCu
5254 let connection ;
5355 if ( ! session . pinnedConnection ) {
5456 // Checkout a connection to build the command.
55- connection = await server . pool . checkOut ( ) ;
57+ connection = await server . pool . checkOut ( { timeoutContext } ) ;
5658 // Pin the connection to the session so it get used to execute the command and we do not
5759 // perform a double check-in/check-out.
5860 session . pin ( connection ) ;
@@ -93,7 +95,13 @@ export class ClientBulkWriteOperation extends CommandOperation<ClientBulkWriteCu
9395 if ( ! this . canRetryWrite ) {
9496 this . options . willRetryWrite = false ;
9597 }
96- return await super . executeCommand ( server , session , command , ClientBulkWriteCursorResponse ) ;
98+ return await super . executeCommand (
99+ server ,
100+ session ,
101+ command ,
102+ timeoutContext ,
103+ ClientBulkWriteCursorResponse
104+ ) ;
97105 }
98106}
99107
0 commit comments