Skip to content

Commit

Permalink
Fix ClassLoader leak in KeycloakDevServicesProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Aug 6, 2024
1 parent a64039a commit d30d070
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ public DevServicesResultBuildItem startKeycloakContainer(
StartupLogCompressor compressor = new StartupLogCompressor(
(launchMode.isTest() ? "(test) " : "") + "Keycloak Dev Services Starting:",
consoleInstalledBuildItem, loggingSetupBuildItem);
if (vertxInstance == null) {
vertxInstance = Vertx.vertx();
}
try {
List<String> errors = new ArrayList<>();

Expand Down Expand Up @@ -281,6 +278,12 @@ private Map<String, String> prepareConfiguration(

List<String> realmNames = new LinkedList<>();

// this needs to be only if we actually start the dev-service as it adds a shutdown hook
// whose TCCL is the Augmentation CL, which if not removed, causes a massive memory leaks
if (vertxInstance == null) {
vertxInstance = Vertx.vertx();
}

WebClient client = OidcDevServicesUtils.createWebClient(vertxInstance);
try {
String adminToken = getAdminToken(client, clientAuthServerBaseUrl);
Expand Down

0 comments on commit d30d070

Please sign in to comment.