Expand my Community achievements bar.

WorkflowExternalProcess: correct way to handle bundle restart during polling execution

Avatar

Level 2

Hi,

I am using WorkflowExternalProcess step to organize polling of some remote job status. And it all works as expected with exception of one case:

If there is a running workflow using that step and it's currently in polling phase (meaning that AEM with some interval invokes hasFinished method of process implementation), then deploying code package (with that custom external process step implementation) seems to be affecting execution of a polling in a way that there would appear dozens of additional watchers for that process to finish. Normally in log file for every poll interval (e.g. invocation of hasFinished) I would see one info log entry per interval. After code deployment there would be thousands of those entries, all of them show that additional process watchers had been created, like below:

18.12.2017 23:53:52.774 *WARN* [sling-threadpool-c3043221-d8c9-45f9-87d8-80da38b080f6-(apache-sling-job-thread-pool)-1459-Granite Workflow External Process Polling Queue(com/adobe/granite/workflow/external/polling/event)] ...

And they seem to continue appearing even after workflow finished until eventually timeout for that step happens.

Whats the correct way to handle bundle restart/refresh (I assume this is what happening after code deployment) in case of external polling going on?

Thanks

1 Reply