From 734fc057f29936487fe4029a6ed3b3a38c48e415 Mon Sep 17 00:00:00 2001 From: lprimak Date: Mon, 2 Dec 2024 19:56:35 -0600 Subject: [PATCH] bugfix: fixed leak by popping current context when application prep fails, or app is not run on current instance --- .../com/sun/enterprise/v3/server/ApplicationLifecycle.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/server/ApplicationLifecycle.java b/nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/server/ApplicationLifecycle.java index 4329a06d885..b3eb8bcb7cc 100644 --- a/nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/server/ApplicationLifecycle.java +++ b/nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/server/ApplicationLifecycle.java @@ -604,6 +604,7 @@ public void actOn(Logger logger) { if (report.getActionExitCode() != ActionReport.ExitCode.SUCCESS) { context.postDeployClean(false /* not final clean-up yet */); events.send(new Event<>(Deployment.DEPLOYMENT_FAILURE, context)); + currentDeploymentContext.get().pop(); } } ApplicationDeployment depl = new ApplicationDeployment(appInfo, context); @@ -646,8 +647,8 @@ public void initialize(ApplicationInfo appInfo, Collection sn events.send(new Event<>(Deployment.DEPLOYMENT_SUCCESS, appInfo)); } } - currentDeploymentContext.get().pop(); } + currentDeploymentContext.get().pop(); } @Override