Skip to content

Commit

Permalink
[WFCORE-6395] Clean up Operation Context only for server processes
Browse files Browse the repository at this point in the history
  • Loading branch information
yersan committed Jun 15, 2023
1 parent 84f15ef commit c9020e2
Showing 1 changed file with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,22 +251,24 @@ final class OperationContextImpl extends AbstractOperationContext implements Aut

@Override
public void close() {
this.originalModel = this.managementModel = null;
this.lockStep = this.containerMonitorStep = null;
this.contextAttachments.close();
synchronized (this.realRemovingControllers) {
this.realRemovingControllers.clear();
this.removalSteps.clear();
}
this.addedRequirements.clear();
this.removedCapabilities.clear();
this.affectsModel.clear();
this.authorizations.clear();
this.serviceTargets.clear();
this.serviceRegistries.clear();

// DON'T close 'attachments' -- that object is owned by ModelControllerImpl
super.close();
if (getProcessType().isServer()) {
this.originalModel = this.managementModel = null;
this.lockStep = this.containerMonitorStep = null;
this.contextAttachments.close();
synchronized (this.realRemovingControllers) {
this.realRemovingControllers.clear();
this.removalSteps.clear();
}
this.addedRequirements.clear();
this.removedCapabilities.clear();
this.affectsModel.clear();
this.authorizations.clear();
this.serviceTargets.clear();
this.serviceRegistries.clear();

// DON'T close 'attachments' -- that object is owned by ModelControllerImpl
super.close();
}
}

public InputStream getAttachmentStream(final int index) {
Expand Down

0 comments on commit c9020e2

Please sign in to comment.