File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -333,6 +333,10 @@ export class Server extends TypedEventEmitter<ServerEvents> {
333
333
// attempt to check out a connection from the pool. This ensures that operations that
334
334
// are waiting for a connection are included in the operation count. Load balanced
335
335
// mode will only ever have a single server, so the operation count doesn't matter.
336
+ // Incrementing the operation count above the logic to handle load balanced mode would
337
+ // require special logic to decrement it again, or would double increment (the load
338
+ // balanced code makes a recursive call). Instead, we increment the count after this
339
+ // check.
336
340
if ( this . loadBalanced && session && conn == null && isPinnableCommand ( cmd , session ) ) {
337
341
this . s . pool . checkOut ( ( err , checkedOut ) => {
338
342
if ( err || checkedOut == null ) {
You can’t perform that action at this time.
0 commit comments