Skip to content
Draft
Show file tree
Hide file tree
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
82 changes: 63 additions & 19 deletions api/matchingservice/v1/request_response.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ message PollWorkflowTaskQueueResponse {
// Raw history bytes sent from matching service when history.sendRawHistoryBetweenInternalServices is enabled.
// Matching client will deserialize this to History when it receives the response.
temporal.api.history.v1.History raw_history = 22;
// When true, this empty response was caused by the server rejecting the poll
// because the worker has been shut down via the ShutdownWorker API.
bool shutdown_worker_rejected = 23;
}

// PollWorkflowTaskQueueResponseWithRawHistory is wire-compatible with PollWorkflowTaskQueueResponse.
Expand Down Expand Up @@ -114,6 +117,9 @@ message PollWorkflowTaskQueueResponseWithRawHistory {
// When matching client deserializes this to PollWorkflowTaskQueueResponse, this field
// will be automatically deserialized to the raw_history field as History.
repeated bytes raw_history = 22;
// When true, this empty response was caused by the server rejecting the poll
// because the worker has been shut down via the ShutdownWorker API.
bool shutdown_worker_rejected = 23;
}

message PollActivityTaskQueueRequest {
Expand Down Expand Up @@ -151,6 +157,9 @@ message PollActivityTaskQueueResponse {
temporal.api.common.v1.RetryPolicy retry_policy = 19;
// ID of the activity run (applicable for standalone activities only)
string activity_run_id = 20;
// When true, this empty response was caused by the server rejecting the poll
// because the worker has been shut down via the ShutdownWorker API.
bool shutdown_worker_rejected = 21;
}

message AddWorkflowTaskRequest {
Expand Down Expand Up @@ -585,6 +594,9 @@ message PollNexusTaskQueueRequest {
message PollNexusTaskQueueResponse {
// Response that should be delivered to the worker containing a request from DispatchNexusTaskRequest.
temporal.api.workflowservice.v1.PollNexusTaskQueueResponse response = 1;
// When true, this empty response was caused by the server rejecting the poll
// because the worker has been shut down via the ShutdownWorker API.
bool shutdown_worker_rejected = 2;
}

message RespondNexusTaskCompletedRequest {
Expand Down
6 changes: 6 additions & 0 deletions service/frontend/workflow_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,8 @@ func (wh *WorkflowHandler) PollWorkflowTaskQueue(ctx context.Context, request *w
Queries: matchingResp.Queries,
Messages: matchingResp.Messages,
PollerScalingDecision: matchingResp.PollerScalingDecision,
// TODO: propagate ShutdownWorkerRejected once go.temporal.io/api is bumped
// to include the new field: matchingResp.ShutdownWorkerRejected
}, nil
}

Expand Down Expand Up @@ -1225,6 +1227,8 @@ func (wh *WorkflowHandler) PollActivityTaskQueue(ctx context.Context, request *w
PollerScalingDecision: matchingResponse.PollerScalingDecision,
Priority: matchingResponse.Priority,
RetryPolicy: matchingResponse.RetryPolicy,
// TODO: propagate ShutdownWorkerRejected once go.temporal.io/api is bumped
// to include the new field: matchingResponse.ShutdownWorkerRejected
}, nil
}

Expand Down Expand Up @@ -5641,6 +5645,8 @@ func (wh *WorkflowHandler) PollNexusTaskQueue(ctx context.Context, request *work
return nil, err
}

// TODO: propagate matchingResponse.ShutdownWorkerRejected to the public
// PollNexusTaskQueueResponse once go.temporal.io/api is bumped.
return matchingResponse.GetResponse(), nil
}

Expand Down
Loading
Loading