Zombie task is created after finishing callable subprocess. How to avoid it?
Hi all
We're using ivy 6.3, and have face the problem that we implement a restfulAPI by java code, when we trigger the callable subprocess from it. After callablesub is finished, it will remain a zombie task.
![alt text][1]
Why i need to call ivy subprocess from api?
Answer: i need to call ivy.repo() to persist my data then response the id. This api can't be called in restful.
Here is my callable subprocess:
![alt text][2]
and it's the code of api:
@Path("{applicationName}/individualch")
@Produces(MediaType.APPLICATION_JSON)
public class IndividualchApi {
/**
* This API is used by third party application when it want to call
* to create dossier Response message is cobId
* @param provider
* @param externalId
* @param sobDossier
* @return
*/
@POST
@Path("/dossiers")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response createIndividualCHDossier(@NotNull String provider, @NotNull String externalId, SobDossier sobDossier) {
if (StringUtils.isBlank(provider) || StringUtils.isBlank(externalId) || sobDossier == null) {
return Response.status(Status.BAD_REQUEST).entity(new ResponseExceptionMessage()
.errorCode(DossierCreationServiceExceptionType.BAD_REQUEST.getUniqueCode().toString())
.message("Invalid params")).build();
}
return new CreateDossierHandlerService().createIndividualCHDossier(provider, externalId, sobDossier);
}
}
And here is the way we trigger subprocess from service:
SubProcessCallResult callResult = SubProcessCall.withPath(CREATE_DOSSIER_HANDLER_PROCESS_NAME)
.withStartSignature("createDossier(String,String,SobDossier)")
.withParam(PARAM_PROVIDER, provider).withParam(PARAM_EXTERNAL_ID, externalId)
.withParam(PARAM_SOB_DOSSIER, sobDossier)
.call();
My Question:
1. Is it a good solution to go? I actually can't call ivy.repo() inside my service. How can we prevent this kind of zomebie task?
2. If we can't prevent zombie task, how ivy handle this kind of task? Does ivy clean it up automatically?
Thanks all
[1]: https://answers.axonivy.com/upfiles/Untitled_OKBhfzB.png
[2]: https://answers.axonivy.com/upfiles/Untitled_xUuYAvG.png