Skip to content

Conversation

cgillum
Copy link
Member

@cgillum cgillum commented Jan 27, 2025

This PR adds a StreamInstanceHistory API to both the BackendService and TaskHubSidecarService services in the protos directory. The purpose of these APIs is to allow a worker to get the history of an orchestration as a series of one-way messages to avoid exceeding gRPC message size limits.

With this change, the backend service can now return orchestrator work items that exclude the history if the history is known to be too large. When it does this, it should set the requiresHistoryStreaming field to true so that the worker can distinguish between no history and omitted history. Workers opt into this behavior change by setting a new GetWorkItemsRequest.supportsHistoryStreaming field.

This PR also introduces a new numEventsProcessed field to CompleteOrchestrationWorkItemRequest. This is a new optional field that tells the backend service how many new events in the received work item were actually processed. This is needed in cases where a worker is only able to process a subset of the events in the work item. The backend service can use this information to only delete a subset of the "inbox" messages that were sent to the worker. The expectation is that the backend will re-send the unprocessed events in subsequent work items.

Copy link
Member

@sebastianburckhardt sebastianburckhardt left a comment

Choose a reason for hiding this comment

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

LGTM

@cgillum cgillum merged commit c672a0d into main Jan 30, 2025
1 check passed
@cgillum cgillum deleted the cgillum/history-streaming branch January 30, 2025 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants