diff --git a/src/operations/client_bulk_write/client_bulk_write.ts b/src/operations/client_bulk_write/client_bulk_write.ts index b04c978114..82d45793ac 100644 --- a/src/operations/client_bulk_write/client_bulk_write.ts +++ b/src/operations/client_bulk_write/client_bulk_write.ts @@ -2,6 +2,7 @@ import { MongoClientBulkWriteExecutionError, ServerType } from '../../beta'; import { ClientBulkWriteCursorResponse } from '../../cmap/wire_protocol/responses'; import type { Server } from '../../sdam/server'; import type { ClientSession } from '../../sessions'; +import { type TimeoutContext } from '../../timeout'; import { MongoDBNamespace } from '../../utils'; import { CommandOperation } from '../command'; import { Aspect, defineAspects } from '../operation'; @@ -35,14 +36,15 @@ export class ClientBulkWriteOperation extends CommandOperation { let command; if (server.description.type === ServerType.LoadBalancer) { if (session) { // Checkout a connection to build the command. - const connection = await server.pool.checkOut(); + const connection = await server.pool.checkOut({ timeoutContext }); // Pin the connection to the session so it get used to execute the command and we do not // perform a double check-in/check-out. session.pin(connection); @@ -69,7 +71,13 @@ export class ClientBulkWriteOperation extends CommandOperation