|
22 | 22 | import static org.apache.accumulo.core.util.LazySingletons.RANDOM;
|
23 | 23 |
|
24 | 24 | import java.io.IOException;
|
| 25 | +import java.io.InterruptedIOException; |
25 | 26 | import java.time.Duration;
|
26 | 27 | import java.util.ArrayList;
|
27 | 28 | import java.util.Collection;
|
@@ -210,6 +211,8 @@ public static class ScanState {
|
210 | 211 |
|
211 | 212 | Duration busyTimeout;
|
212 | 213 |
|
| 214 | + volatile boolean closeInitiated = false; |
| 215 | + |
213 | 216 | TabletLocation getErrorLocation() {
|
214 | 217 | return prevLoc;
|
215 | 218 | }
|
@@ -506,8 +509,13 @@ public static List<KeyValue> scan(ClientContext context, ScanState scanState, Du
|
506 | 509 | TraceUtil.setException(child2, e, false);
|
507 | 510 | sleepMillis = pause(sleepMillis, maxSleepTime, scanState.runOnScanServer);
|
508 | 511 | } catch (TException e) {
|
509 |
| - TabletLocator.getLocator(context, scanState.tableId).invalidateCache(context, |
510 |
| - loc.getTserverLocation()); |
| 512 | + boolean wasInterruptedAfterClose = |
| 513 | + e.getCause() != null && e.getCause().getClass().equals(InterruptedIOException.class) |
| 514 | + && scanState.closeInitiated; |
| 515 | + if (!wasInterruptedAfterClose) { |
| 516 | + TabletLocator.getLocator(context, scanState.tableId).invalidateCache(context, |
| 517 | + loc.getTserverLocation()); |
| 518 | + } |
511 | 519 | error = "Scan failed, thrift error " + e.getClass().getName() + " " + e.getMessage()
|
512 | 520 | + " " + scanState.getErrorLocation();
|
513 | 521 | if (!error.equals(lastError)) {
|
|
0 commit comments