Quickly retry activities on different worker after graceful shutdown

From what I got so far, when a worker that has been started with w.Run(worker.InterruptCh()) gets SIGTERM it will do graceful shutdown by not polling for new activities and wait a while for the in-progress activities to finish

Once this waiting time is over, Worker will be terminated & in-progress activities that was not finished will timeout based on the configured settings for

If the goal was to quickly retry the activity on different worker when the original worker shut down.
HeatbeatTimeout can be used, But what if the activity is doing blocking IO logic that will make it hard to keep sending heartbeats. is it recommended practice to use some goroutine in such activities to keep sending heartbeat?

Is there is another way (using Interceptors for example) to mark these in-progress activities as failed during the graceful shutdown to be able to retry quickly on different worker?
Instead of implementing heartbeat logic for every single activity

If the blocking IO is blocking for a very long time, then heartbeating from another goroutine is OK.

Also consider listening on WorkerStopChannel which is closed as soon as the worker shutdown is initiated.

Great!
Is there is a built-in support in go sdk to get list of in-progress activities in the current worker & mark them as failed (to cause a retry on another worker) ?

You can write an activity interceptor that would subscribe to WorkerStopChannel and fail the activity once it is closed.

Thanks for the info
Will try it out!