File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -321,6 +321,10 @@ function executeRetryableRead(command, session) {
321321 if (timeoutMS != null && isExpired (timeoutMS ) {
322322 throw previousError;
323323 }
324+ /* CSOT is not enabled, and we have already tried once */
325+ if (timeoutMS == null && retrying ) {
326+ throw previousError;
327+ }
324328 continue ;
325329 }
326330
@@ -359,6 +363,12 @@ function executeRetryableRead(command, session) {
359363 updateTopologyDescriptionForNotWritablePrimaryError(server , notPrimaryError );
360364 previousError = notPrimaryError ;
361365 previousServer = server ;
366+ } catch (Exception error when error .code in RETRYABLE_ERROR_CODES ) {
367+ /* Catches remaining server errors with retryable error codes as defined
368+ * in the Retryable Error section. */
369+ updateTopologyDescriptionForError(server , error );
370+ previousError = error ;
371+ previousServer = server ;
362372 } catch (DriverException error ) {
363373 if ( previousError != null ) {
364374 throw previousError ;
You can’t perform that action at this time.
0 commit comments