Skip to content

Commit

Permalink
Merge pull request wildfly#17212 from marcosgopen/WFLY-18537
Browse files Browse the repository at this point in the history
WFLY-18537 Memory leak :reload operation
  • Loading branch information
bstansberry authored Sep 26, 2023
2 parents 7c8f4da + 69f16f0 commit 4fad550
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@
<version.org.wildfly.http-client>2.0.2.Final</version.org.wildfly.http-client>
<version.org.wildfly.naming-client>2.0.1.Final</version.org.wildfly.naming-client>
<version.org.wildfly.security.elytron-mp>2.0.0.Final</version.org.wildfly.security.elytron-mp>
<version.org.wildfly.transaction.client>3.0.0.Final</version.org.wildfly.transaction.client>
<version.org.wildfly.transaction.client>3.0.1.Final</version.org.wildfly.transaction.client>
<preview.version.org.wildfly.wildfly-ee-9-deployment-transformer>1.0.0.Final</preview.version.org.wildfly.wildfly-ee-9-deployment-transformer>
<version.software.amazon.awssdk>2.20.126</version.software.amazon.awssdk>
<version.software.amazon.eventstream>1.0.1</version.software.amazon.eventstream>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public final class LocalTransactionContextService implements Service<LocalTransa
private final InjectedValue<XAResourceRecoveryRegistry> xaResourceRecoveryRegistryInjector = new InjectedValue<>();
private final InjectedValue<ServerEnvironment> serverEnvironmentInjector = new InjectedValue<>();
private final int staleTransactionTime;
private JBossLocalTransactionProvider provider;

public LocalTransactionContextService(final int staleTransactionTime) {
this.staleTransactionTime = staleTransactionTime;
Expand All @@ -62,7 +63,8 @@ public void start(final StartContext context) throws StartException {
builder.setXAResourceRecoveryRegistry(xaResourceRecoveryRegistryInjector.getValue());
builder.setXARecoveryLogDirRelativeToPath(serverEnvironmentInjector.getValue().getServerDataDir().toPath());
builder.setStaleTransactionTime(staleTransactionTime);
final LocalTransactionContext transactionContext = this.context = new LocalTransactionContext(builder.build());
this.provider = builder.build();
final LocalTransactionContext transactionContext = this.context = new LocalTransactionContext(this.provider);
// TODO: replace this with per-CL settings for embedded use and to support remote UserTransaction
doPrivileged((PrivilegedAction<Void>) () -> {
LocalTransactionContext.getContextManager().setGlobalDefault(transactionContext);
Expand All @@ -78,6 +80,7 @@ public void start(final StartContext context) throws StartException {
}

public void stop(final StopContext context) {
this.provider.removeXAResourceRecovery(xaResourceRecoveryRegistryInjector.getValue());
this.context = null;
// TODO: replace this with per-CL settings for embedded use and to support remote UserTransaction
doPrivileged((PrivilegedAction<Void>) () -> {
Expand Down

0 comments on commit 4fad550

Please sign in to comment.