Skip to content

Commit

Permalink
fix: RejectedExecutionException on shutdown (#652)
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert authored Oct 12, 2023
1 parent b77e44e commit 8c595b0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
10 changes: 0 additions & 10 deletions src/main/java/dev/openfeature/sdk/ProviderRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,6 @@ public void shutdown() {
.concat(Stream.of(this.defaultProvider.get()), this.providers.values().stream())
.distinct()
.forEach(this::shutdownProvider);
setProvider(new NoOpProvider(),
(FeatureProvider fp) -> {
},
(FeatureProvider fp) -> {
},
(FeatureProvider fp) -> {
},
(FeatureProvider fp,
String message) -> {
}, false);
this.providers.clear();
taskExecutor.shutdown();
}
Expand Down
9 changes: 0 additions & 9 deletions src/test/java/dev/openfeature/sdk/ProviderRepositoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,6 @@ void shouldShutdownAllFeatureProvidersOnShutdown() {
setFeatureProvider(ANOTHER_CLIENT_NAME, featureProvider2);

providerRepository.shutdown();

await()
.pollDelay(Duration.ofMillis(1))
.atMost(Duration.ofSeconds(TIMEOUT))
.untilAsserted(() -> {
assertThat(providerRepository.getProvider()).isInstanceOf(NoOpProvider.class);
assertThat(providerRepository.getProvider(CLIENT_NAME)).isInstanceOf(NoOpProvider.class);
assertThat(providerRepository.getProvider(ANOTHER_CLIENT_NAME)).isInstanceOf(NoOpProvider.class);
});
verify(featureProvider1, timeout(TIMEOUT)).shutdown();
verify(featureProvider2, timeout(TIMEOUT)).shutdown();
}
Expand Down

0 comments on commit 8c595b0

Please sign in to comment.