I’ve put together a simple worker example that registers a couple of Activities and a simple 2 stage workflow that runs as a cron job. When I shutdown the worker I’ve noticed that it takes quite a long time for it to be removed from the list of “Pollers” in the webapp.
I’ve added a listener for when the java main shuts down and call the WorkerFactory.shutdown() method.
If I startup the worker again (to simulate what will happen in k8) I see multiple Pollers in the list, the old one and the new one.
Does calling shutdown() on the WorkerFactory shutdown the worker correctly or do I need to call something else as well?
Is there a reason why the old worker takes so long to get removed. It can take 10-15mins for it to be removed from the list?
While the old worker remains in the list can it have any adverse affects on the running of the workflows?
Part of the reason I’m asking these questions is that the cron job I’m testing is set to run every minute but takes a long time before it actually triggers. I saw in another thread something about the WorkflowExecutionStarted.FirstWorkflowTaskBackoff? This explains why the cron job took so long to trigger but is this a setting that can be changed so the initial job triggers correctly i.e. if the cron is set to every minute it triggers after a minute?