Skip to content

Commit b9e1ca6

Browse files
jarebudevKavindu-Dodan
authored andcommitted
addressed sonar issue with not handling interrupt during waiting
Signed-off-by: jarebudev <[email protected]>
1 parent a483239 commit b9e1ca6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/dev/openfeature/sdk/EventSupport.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,15 @@ public void runHandler(Consumer<EventDetails> handler, EventDetails eventDetails
152152
* or timeout period has elapsed.
153153
*/
154154
public void shutdown() {
155+
taskExecutor.shutdown();
155156
try {
156-
taskExecutor.shutdown();
157157
if (!taskExecutor.awaitTermination(SHUTDOWN_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
158158
log.warn("Task executor did not terminate before the timeout period had elapsed");
159+
taskExecutor.shutdownNow();
159160
}
160-
} catch (Exception e) {
161-
log.warn("Exception while attempting to shutdown task executor", e);
161+
} catch (InterruptedException e) {
162+
taskExecutor.shutdownNow();
163+
Thread.currentThread().interrupt();
162164
}
163165
}
164166

0 commit comments

Comments
 (0)