@@ -409,6 +409,28 @@ SingleServerRequestRunnable createSingleServerRequest(MultiAction multiAction, i
409409 return new SingleServerRequestRunnable (multiAction , numAttempt , server , callsInProgress );
410410 }
411411
412+ /**
413+ * Some checked calls send a callable with their own tracker. This method checks the operation
414+ * timeout against the appropriate tracker, or returns false if no tracker.
415+ */
416+ private boolean isOperationTimeoutExceeded () {
417+ RetryingTimeTracker currentTracker ;
418+ if (tracker != null ) {
419+ currentTracker = tracker ;
420+ } else if (currentCallable != null && currentCallable .getTracker () != null ) {
421+ currentTracker = currentCallable .getTracker ();
422+ } else {
423+ return false ;
424+ }
425+
426+ // no-op if already started, this is just to ensure it was initialized (usually true)
427+ currentTracker .start ();
428+
429+ // return value of 1 is special to mean exceeded, to differentiate from 0
430+ // which is no timeout. see implementation of getRemainingTime
431+ return currentTracker .getRemainingTime (operationTimeout ) == 1 ;
432+ }
433+
412434 /**
413435 * Group a list of actions per region servers, and send them.
414436 * @param currentActions - the list of row to submit
@@ -420,9 +442,7 @@ void groupAndSendMultiAction(List<Action> currentActions, int numAttempt) {
420442 boolean isReplica = false ;
421443 List <Action > unknownReplicaActions = null ;
422444 for (Action action : currentActions ) {
423- if (tracker .getRemainingTime (operationTimeout ) == 1 ) {
424- // return value of 1 is special to mean exceeded, to differentiate from 0
425- // which is no timeout. see implementation of getRemainingTime
445+ if (isOperationTimeoutExceeded ()) {
426446 String message = numAttempt == 1
427447 ? "Operation timeout exceeded during resolution of region locations, "
428448 + "prior to executing any actions."
0 commit comments