Apache9 commented on a change in pull request #3261:
URL: https://github.com/apache/hbase/pull/3261#discussion_r637380447



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java
##########
@@ -794,11 +795,27 @@ void shutdownLongCompactions(){
   }
 
   public void clearLongCompactionsQueue() {
-    longCompactions.getQueue().clear();
+    removeFromFilesCompacting(longCompactions);
   }
 
   public void clearShortCompactionsQueue() {
-    shortCompactions.getQueue().clear();
+    removeFromFilesCompacting(shortCompactions);
+  }
+
+  private void removeFromFilesCompacting(ThreadPoolExecutor compactor) {
+    Iterator<Runnable> iter = compactor.getQueue().iterator();
+    while (iter.hasNext()) {
+      Runnable runnable = iter.next();
+      if (!(runnable instanceof CompactionRunner)) {
+        continue;
+      }
+      CompactionRunner runner = (CompactionRunner) runnable;
+      if (runner.compaction != null && runner.compaction.hasSelection()) {

Review comment:
       No data race here? Not sure, just asking




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to