Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1109,11 +1109,16 @@ message ResetStickyTaskQueueResponse {
}

message ShutdownWorkerRequest {
message WorkerPollerTaskQueue {
string name = 1;
temporal.api.enums.v1.TaskQueueType type = 2;
}

string namespace = 1;
// sticky_task_queue may not always be populated. We want to ensure all workers
// send a shutdown request to update worker state for heartbeating, as well
// as cancel pending poll calls early, instead of waiting for timeouts.
string sticky_task_queue = 2;
string sticky_task_queue = 2 [deprecated = true];
string identity = 3;
string reason = 4;
temporal.api.worker.v1.WorkerHeartbeat worker_heartbeat = 5;
Expand All @@ -1124,10 +1129,16 @@ message ShutdownWorkerRequest {
// Task queue name the worker is polling on. This allows server to cancel
// all outstanding poll RPC calls from SDK. This avoids a race condition that
// can lead to tasks being lost.
string task_queue = 7;
string task_queue = 7 [deprecated = true];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, you can just make this repeated, no need to add a new field.

But, it's useful to know which is the sticky one since then we don't have to fan out the cancels to an activity queue with the sticky name (which doesn't exist). And the session queue is only an activity queue, right? So it seems like we should just have a list of name+type pairs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the context on server's behavior, I added a new WorkerPollerTaskQueue type to be name+type

// Task queue types that help server cancel outstanding poll RPC
// calls from SDK. This avoids a race condition that can lead to tasks being lost.
repeated temporal.api.enums.v1.TaskQueueType task_queue_types = 8;
repeated temporal.api.enums.v1.TaskQueueType task_queue_types = 8 [deprecated = true];
// Task queues the worker is polling on. This allows server to cancel
// all outstanding poll RPC calls from SDK. This avoids a race condition that
// can lead to tasks being lost. Each entry identifies a specific task queue
// name and type pair, allowing the same task queue name to appear multiple
// times for workers polling more than one task queue type.
repeated WorkerPollerTaskQueue task_queues = 9;
}

message ShutdownWorkerResponse {
Expand Down
Loading