File tree Expand file tree Collapse file tree
providers/ofrep/src/main/java/dev/openfeature/contrib/providers/ofrep Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,12 +90,19 @@ public Metadata getMetadata() {
9090 @ Override
9191 public void shutdown () {
9292 if (executor instanceof ExecutorService ) {
93+ ExecutorService executorService = (ExecutorService ) executor ;
9394 try {
94- ExecutorService executorService = (ExecutorService ) executor ;
95- executorService .shutdownNow ();
96- executorService .awaitTermination (DEFAULT_EXECUTOR_SHUTDOWN_TIMEOUT , TimeUnit .MILLISECONDS );
95+ executorService .shutdown ();
96+
97+ if (!executorService .awaitTermination (DEFAULT_EXECUTOR_SHUTDOWN_TIMEOUT , TimeUnit .MILLISECONDS )) {
98+ executorService .shutdownNow ();
99+ if (!executorService .awaitTermination (DEFAULT_EXECUTOR_SHUTDOWN_TIMEOUT , TimeUnit .MILLISECONDS )) {
100+ log .error ("Provider couldn't shutdown gracefully." );
101+ }
102+ }
97103 } catch (InterruptedException e ) {
98- log .error ("Error during shutdown {}" , OFREP_PROVIDER , e );
104+ executorService .shutdownNow ();
105+ Thread .currentThread ().interrupt ();
99106 }
100107 }
101108 }
You can’t perform that action at this time.
0 commit comments