Skip to content

Commit

Permalink
Merge pull request quarkusio#42338 from geoand/quarkusio#42303
Browse files Browse the repository at this point in the history
Fix ClassLoader leak in KeycloakDevServicesProcessor
  • Loading branch information
geoand authored Aug 6, 2024
2 parents cb5d48d + d30d070 commit 39ec432
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 39ec432

Please sign in to comment.