Skip to content

Commit aa6e61c

Browse files
committed
Merge branch '2.1' into 3.1
2 parents cdf30d0 + 6555fc1 commit aa6e61c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

core/src/main/java/org/apache/accumulo/core/clientImpl/ScannerIterator.java

+2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ public Entry<Key,Value> next() {
128128
}
129129

130130
void close() {
131+
// setting this so that some errors can be ignored
132+
scanState.closeInitiated = true;
131133
// run actual close operation in the background so this does not block.
132134
context.executeCleanupTask(() -> {
133135
synchronized (scanState) {

core/src/main/java/org/apache/accumulo/core/clientImpl/ThriftScanner.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import static org.apache.accumulo.core.util.LazySingletons.RANDOM;
2323

2424
import java.io.IOException;
25+
import java.io.InterruptedIOException;
2526
import java.time.Duration;
2627
import java.util.ArrayList;
2728
import java.util.Collection;
@@ -210,6 +211,8 @@ public static class ScanState {
210211

211212
Duration busyTimeout;
212213

214+
volatile boolean closeInitiated = false;
215+
213216
TabletLocation getErrorLocation() {
214217
return prevLoc;
215218
}
@@ -506,8 +509,13 @@ public static List<KeyValue> scan(ClientContext context, ScanState scanState, Du
506509
TraceUtil.setException(child2, e, false);
507510
sleepMillis = pause(sleepMillis, maxSleepTime, scanState.runOnScanServer);
508511
} 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+
}
511519
error = "Scan failed, thrift error " + e.getClass().getName() + " " + e.getMessage()
512520
+ " " + scanState.getErrorLocation();
513521
if (!error.equals(lastError)) {

0 commit comments

Comments
 (0)