Skip to content

Commit

Permalink
Merge pull request #19984 from stuartwdouglas/cleanup-last
Browse files Browse the repository at this point in the history
Release the context manager last
  • Loading branch information
stuartwdouglas authored Sep 8, 2021
2 parents 4621f42 + ad11e63 commit 28acd97
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public void configureRuntime(ExecutorService executorService, ShutdownContext sh
SmallRyeContextManager contextManager = builder.build();

contextManagerProvider.registerContextManager(contextManager, Thread.currentThread().getContextClassLoader());
shutdownContext.addShutdownTask(new Runnable() {
//needs to be late, as running threads can re-create an implicit one
shutdownContext.addLastShutdownTask(new Runnable() {
@Override
public void run() {
contextManagerProvider.releaseContextManager(contextManager);
Expand Down

0 comments on commit 28acd97

Please sign in to comment.