3009
partition tqid.Partition,
3010
pollMetadata *pollMetadata,
3012
>
pm, _, err := e.getTaskQueuePartitionManager(ctx, partition, true, loadCausePoll)
3013
>
if err != nil {
3014
return nil, false, err
3015
}
3016
3018
>
3019
>
// We need to set a shorter timeout than the original ctx; otherwise, by the time ctx deadline is
3020
>
// reached, instead of emptyTask, context timeout error is returned to the frontend by the rpc stack,
3021
>
// which counts against our SLO. By shortening the timeout by a very small amount, the emptyTask can be
3022
>
// returned to the handler before a context timeout error is generated.
3023
>
workerInstanceKey := pollMetadata.workerInstanceKey
3024
>
if workerInstanceKey != "" && e.shutdownWorkers.Get(workerInstanceKey) != nil {
3025
e.logger.Info("Rejecting poll from recently-shutdown worker",
3026
tag.WorkflowNamespaceID(partition.NamespaceId()),