handled the case of rejectd execution in distributed executor
@@ -83,6 +83,7 @@ import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
+import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
@@ -375,6 +376,7 @@ public class ODistributedDatabaseImpl implements ODistributedDatabase {
rids,
uniqueKeys,
(guards) -> {
+ try {
this.requestExecutor.submit(
() -> {
try {
@@ -383,6 +385,11 @@ public class ODistributedDatabaseImpl implements ODistributedDatabase {
this.lockManager.unlock(guards);
}
});
+ } catch (RejectedExecutionException e) {
+ task.finished();
+ this.lockManager.unlock(guards);
+ throw e;
+ }
});
} else {
this.requestExecutor.submit(
