Skip to content

Commit 5d0ff6e

Browse files
committed
PR feedback.
1 parent 7686d5f commit 5d0ff6e

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class PollingBase {
1919
private final FDv2Requestor requestor;
20-
private final LDLogger logger;
20+
protected final LDLogger logger;
2121

2222
public PollingBase(FDv2Requestor requestor, LDLogger logger) {
2323
this.requestor = requestor;

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ class PollingSynchronizerImpl extends PollingBase implements Synchronizer {
1717

1818
private final IterableAsyncQueue<FDv2SourceResult> resultQueue = new IterableAsyncQueue<>();
1919

20-
private final LDLogger logger;
21-
2220
public PollingSynchronizerImpl(
2321
FDv2Requestor requestor,
2422
LDLogger logger,
@@ -27,7 +25,6 @@ public PollingSynchronizerImpl(
2725
Duration pollInterval
2826
) {
2927
super(requestor, logger.subLogger(Loggers.POLLING_SYNCHRONIZER));
30-
this.logger = logger;
3128
this.selectorSource = selectorSource;
3229

3330
synchronized (this) {
@@ -74,10 +71,14 @@ private void doPoll() {
7471
} else {
7572
resultQueue.put(res);
7673
}
77-
} catch (InterruptedException | ExecutionException e) {
78-
// If this happens, then the thread running the poll has been interrupted, or the task has been canceled.
74+
} catch (InterruptedException e) {
7975
// This would likely be the result of a shutdown, so we are just logging this for debugging purposes.
76+
// Same with the ExecutionException below.
8077
logger.debug("Polling thread interrupted: {}", e.toString());
78+
Thread.currentThread().interrupt();
79+
}
80+
catch(ExecutionException e) {
81+
logger.debug("Polling thread execution exception: {}", e.toString());
8182
}
8283
}
8384

0 commit comments

Comments
 (0)