Skip to content

Commit 546fa87

Browse files
committed
Use a thread insead of default thread pool for watiing for a FDv1 data source to start.
1 parent 26f5ea7 commit 546fa87

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/DataSourceSynchronizerAdapter.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public CompletableFuture<FDv2SourceResult> next() {
6464

6565
// Monitor the start future for errors
6666
// The data source will emit updates through the listening sink
67-
CompletableFuture.runAsync(() -> {
67+
Thread monitorThread = new Thread(() -> {
6868
try {
6969
startFuture.get();
7070
} catch (ExecutionException e) {
@@ -77,11 +77,14 @@ public CompletableFuture<FDv2SourceResult> next() {
7777
);
7878
resultQueue.put(FDv2SourceResult.interrupted(errorInfo, false));
7979
} catch (CancellationException e) {
80-
// Start future was cancelled (during close) - exit cleanly
80+
// Start future was canceled (during close) - exit cleanly
8181
} catch (InterruptedException e) {
8282
Thread.currentThread().interrupt();
8383
}
8484
});
85+
monitorThread.setName("LaunchDarkly-SDK-Server-DataSourceAdapter-Monitor");
86+
monitorThread.setDaemon(true);
87+
monitorThread.start();
8588
}
8689
}
8790

0 commit comments

Comments
 (0)