dlmarion commented on code in PR #3161:
URL: https://github.com/apache/accumulo/pull/3161#discussion_r1104996149


##########
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletBase.java:
##########
@@ -351,20 +342,19 @@ Batch nextBatch(SortedKeyValueIterator<Key,Value> iter, 
Range range, ScanParamet
   private Tablet.LookupResult lookup(SortedKeyValueIterator<Key,Value> mmfi, 
List<Range> ranges,
       List<KVEntry> results, ScanParameters scanParams, long maxResultsSize) 
throws IOException {
 
-    try {
-      while (context.getLowMemoryDetector().isRunningLowOnMemory(context, 
DetectionScope.SCAN,
-          () -> {
-            return isUserTable;
-          }, () -> {
-            log.info("Not starting lookup because low on memory, extent: {}", 
extent);
-            server.getScanMetrics().incrementScanPausedForLowMemory();
-            Thread.sleep(500);
-          })) {}
-    } catch (InterruptedException e) {
-      // Reset the interrupt state on this thread
-      Thread.interrupted();
-      throw new IOException("Pause for low memory interrupted", e);
-    }
+    while (context.getLowMemoryDetector().isRunningLowOnMemory(context, 
DetectionScope.SCAN, () -> {
+      return isUserTable;
+    }, () -> {
+      log.info("Not starting lookup because low on memory, extent: {}", 
extent);
+      server.getScanMetrics().incrementScanPausedForLowMemory();
+      try {
+        Thread.sleep(500);
+      } catch (InterruptedException e) {
+        Thread.interrupted();

Review Comment:
   `Thread.interrupted()` clears the interrupt state. I don't believe that 
calling `Thread.currentThread.interrupt()` will raise an `InterruptedException` 
here. Since `InterruptedException` may not be handled upstream, I don't know 
what the utility is of setting the interrupt state again. Also, I'm raising a 
different RuntimeException after clearing the state.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to