dimas-b commented on code in PR #4543:
URL: https://github.com/apache/polaris/pull/4543#discussion_r3314088839
##########
persistence/nosql/async/java/src/main/java/org/apache/polaris/nosql/async/java/JavaPoolAsyncExec.java:
##########
@@ -239,7 +240,17 @@ public Cancelable<Void> schedulePeriodic(
@SuppressWarnings("FutureReturnValueIgnored")
private void immediate(CancelableFuture<?> cancelable) {
- executorService.submit(cancelable);
+ try {
+ executorService.submit(cancelable);
+ } catch (RejectedExecutionException e) {
+ if (!cancelable.cancelledOrShutdown()) {
Review Comment:
Right, but my point is that the chance of this `if`'s condition being
`false` is really slim, isn't it?
What's the harm if calling `delayed()` during shutdown?
##########
persistence/nosql/async/java/src/main/java/org/apache/polaris/nosql/async/java/JavaPoolAsyncExec.java:
##########
@@ -239,7 +240,17 @@ public Cancelable<Void> schedulePeriodic(
@SuppressWarnings("FutureReturnValueIgnored")
private void immediate(CancelableFuture<?> cancelable) {
- executorService.submit(cancelable);
+ try {
+ executorService.submit(cancelable);
+ } catch (RejectedExecutionException e) {
+ if (!cancelable.cancelledOrShutdown()) {
Review Comment:
Right, but my point is that the chance of this `if`'s condition being
`false` is really slim, isn't it?
What's the harm of calling `delayed()` during shutdown?
--
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]