@@ -396,6 +396,10 @@ export class RequestExecutor implements IDisposable {
396396 return Promise . resolve ( false ) ;
397397 }
398398
399+ if ( this . _disableTopologyUpdates ) {
400+ return Promise . resolve ( false ) ;
401+ }
402+
399403 const acquiredSemContext = acquireSemaphore ( this . _updateDatabaseTopologySemaphore , { timeout } ) ;
400404 const result = BluebirdPromise . resolve ( acquiredSemContext . promise )
401405 . then ( ( ) => {
@@ -804,7 +808,7 @@ export class RequestExecutor implements IDisposable {
804808 sp . stop ( ) ;
805809
806810 const serverDownHandledSuccessfully = await this . _handleServerDown (
807- req . uri as string , chosenNode , nodeIndex , command , req , response , null , error , sessionInfo ) ;
811+ req . uri as string , chosenNode , nodeIndex , command , req , response , null , error , sessionInfo , shouldRetry ) ;
808812
809813 if ( ! serverDownHandledSuccessfully ) {
810814 this . _throwFailedToContactAllNodes ( command , req , error , null ) ;
@@ -1004,7 +1008,7 @@ export class RequestExecutor implements IDisposable {
10041008 case StatusCodes . BadGateway :
10051009 case StatusCodes . ServiceUnavailable :
10061010 return this . _handleServerDown (
1007- url , chosenNode , nodeIndex , command , req , response , await readBody ( ) , null , sessionInfo ) ;
1011+ url , chosenNode , nodeIndex , command , req , response , await readBody ( ) , null , sessionInfo , shouldRetry ) ;
10081012 case StatusCodes . Conflict :
10091013 RequestExecutor . _handleConflict ( response , await readBody ( ) ) ;
10101014 break ;
@@ -1089,7 +1093,8 @@ export class RequestExecutor implements IDisposable {
10891093 response : HttpResponse ,
10901094 body : string ,
10911095 error : any ,
1092- sessionInfo : SessionInfo ) : Promise < boolean > {
1096+ sessionInfo : SessionInfo ,
1097+ shouldRetry : boolean ) : Promise < boolean > {
10931098
10941099 if ( ! command . failedNodes ) {
10951100 command . failedNodes = new Map ( ) ;
@@ -1118,7 +1123,7 @@ export class RequestExecutor implements IDisposable {
11181123 await this . _executeOnSpecificNode ( command , sessionInfo , {
11191124 chosenNode : currentIndexAndNode . currentNode ,
11201125 nodeIndex : currentIndexAndNode . currentIndex ,
1121- shouldRetry : false
1126+ shouldRetry : shouldRetry
11221127 } ) ;
11231128
11241129 return true ;
0 commit comments