Clean shutdown of activity workers

Hi Team.
I have observed while redeployment of temporal activities on kubernetes,
that pods restart without waiting for currently running activity to complete, which leads to unnecessary retry and failure.
Is there a way to handle clean redeployment of activity code, which shuts down worker only when current activity executions is complete and do not pick any new activity task till deployment is complete.