Skip to content

Commit

Permalink
Fix ClassLoader leak in KeycloakDevServicesProcessor
Browse files Browse the repository at this point in the history
Fixes: quarkusio#42303
(cherry picked from commit d30d070)
  • Loading branch information
geoand authored and gsmet committed Aug 6, 2024
1 parent 2109207 commit d26ad3f
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 d26ad3f

Please sign in to comment.