@@ -2,6 +2,7 @@ import { MongoClientBulkWriteExecutionError, ServerType } from '../../beta';
2
2
import { ClientBulkWriteCursorResponse } from '../../cmap/wire_protocol/responses' ;
3
3
import type { Server } from '../../sdam/server' ;
4
4
import type { ClientSession } from '../../sessions' ;
5
+ import { type TimeoutContext } from '../../timeout' ;
5
6
import { MongoDBNamespace } from '../../utils' ;
6
7
import { CommandOperation } from '../command' ;
7
8
import { Aspect , defineAspects } from '../operation' ;
@@ -43,7 +44,8 @@ export class ClientBulkWriteOperation extends CommandOperation<ClientBulkWriteCu
43
44
*/
44
45
override async execute (
45
46
server : Server ,
46
- session : ClientSession | undefined
47
+ session : ClientSession | undefined ,
48
+ timeoutContext : TimeoutContext
47
49
) : Promise < ClientBulkWriteCursorResponse > {
48
50
let command ;
49
51
@@ -52,7 +54,7 @@ export class ClientBulkWriteOperation extends CommandOperation<ClientBulkWriteCu
52
54
let connection ;
53
55
if ( ! session . pinnedConnection ) {
54
56
// Checkout a connection to build the command.
55
- connection = await server . pool . checkOut ( ) ;
57
+ connection = await server . pool . checkOut ( { timeoutContext } ) ;
56
58
// Pin the connection to the session so it get used to execute the command and we do not
57
59
// perform a double check-in/check-out.
58
60
session . pin ( connection ) ;
@@ -93,7 +95,13 @@ export class ClientBulkWriteOperation extends CommandOperation<ClientBulkWriteCu
93
95
if ( ! this . canRetryWrite ) {
94
96
this . options . willRetryWrite = false ;
95
97
}
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
+ ) ;
97
105
}
98
106
}
99
107
0 commit comments