Skip to content

Commit

Permalink
Merge pull request #5553 from yersan/WFCORE-6395
Browse files Browse the repository at this point in the history
[WFCORE-6395] Clean up Operation Context only for server processes
  • Loading branch information
yersan authored Jun 16, 2023
2 parents f21e803 + c9020e2 commit f1cf376
Showing 1 changed file with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,22 +249,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 f1cf376

Please sign in to comment.