Is your feature request related to a problem? Please describe.
Currently, if an Activity heartbeat too often and the heartbeat gets throttled and cached, an activity finishes without draining or canceling the heartbeat.
Describe the solution you'd like
The last cached heartbeat should be either drained before the activity completion or discarded/canceled.
This also should be happening during graceful worker shutdown.