File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
core/src/main/java/com/datastax/oss/driver/internal/core/config/typesafe Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
### 4.11.2 (in progress)
6
6
7
+ - [ bug] JAVA-2932: Make DefaultDriverConfigLoader.close() resilient to terminated executors
7
8
- [ bug] JAVA-2945: Reinstate InternalDriverContext.getNodeFilter method
8
9
- [ bug] JAVA-2947: Release buffer after decoding multi-slice frame
9
10
- [ bug] JAVA-2946: Make MapperResultProducerService instances be located with user-provided class loader
Original file line number Diff line number Diff line change 39
39
import java .time .Duration ;
40
40
import java .util .concurrent .CompletableFuture ;
41
41
import java .util .concurrent .CompletionStage ;
42
+ import java .util .concurrent .RejectedExecutionException ;
42
43
import java .util .concurrent .TimeUnit ;
43
44
import java .util .function .Supplier ;
44
45
import net .jcip .annotations .ThreadSafe ;
@@ -235,8 +236,14 @@ public Supplier<Config> getConfigSupplier() {
235
236
@ Override
236
237
public void close () {
237
238
SingleThreaded singleThreaded = this .singleThreaded ;
238
- if (singleThreaded != null ) {
239
- RunOrSchedule .on (singleThreaded .adminExecutor , singleThreaded ::close );
239
+ if (singleThreaded != null && !singleThreaded .adminExecutor .terminationFuture ().isDone ()) {
240
+ try {
241
+ RunOrSchedule .on (singleThreaded .adminExecutor , singleThreaded ::close );
242
+ } catch (RejectedExecutionException e ) {
243
+ // Checking the future is racy, there is still a tiny window that could get us here.
244
+ // We can safely ignore this error because, if the execution is rejected, the periodic
245
+ // reload task, if any, has been already cancelled.
246
+ }
240
247
}
241
248
}
242
249
You can’t perform that action at this time.
0 commit comments