I am using this code to shutdown worker:
workerFactory.shutdown();
workerFactory.awaitTermination(terminationTimeout, TimeUnit.SECONDS);
Based on documentation:
Activities are allowed to complete during the graceful shutdown period.
And some comment on this forum, like this
I have an impression that if there is a running Activity, worker will wait for terminationTimeout before killing it.
Instead, I am getting this message:
Wait for a graceful shutdown of SyncActivityWorker{}#heartbeatExecutor timed out, fallback to shutdownNow()
And worker shutdown immediately.
Is it expected behavior? If yes, is there any other way to get Activity some time to complete?