Repository navigation
WorkerSessionOptions + ActivitySessionOptions -- Defining Sessions #885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Shivs11
wants to merge
32
commits into
main
Choose a base branch
from
sticky-activity-session-options
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
b23db7b
Add activity session_options
ShahabT c28c289
`single_workflow_mode` poll flag
ShahabT 7132c51
Model single-session isolation in poll session options
THardy98 be0506d
Clarify session affinity documentation and remove dev reservations
THardy98 d59dfca
Name worker session options and use next available poll tags
THardy98 01c117a
Rename activity routing intent to use_workflow_session
THardy98 6811161
Record activity session options in scheduled history events
THardy98 c561d0b
Merge remote-tracking branch 'origin/main' into sticky-activity-sessi…
THardy98 d183f54
Propose basic session API shape (#893)
THardy98 7fd0921
Document that stable_identity is required
THardy98 d6e6f6d
Merge remote-tracking branch 'origin/main' into shivam/885-sync-main
Shivs11 47cb323
Renumber session_options to 12 and regenerate openapi
Shivs11 3f47869
Add MultiSessionOptions; route its sessions to the instance-key stick…
Shivs11 a54da84
Record a workflow's session info on history events
Shivs11 4686407
Move BoundWorkerInfo's future-fields note into its doc comment for ap…
Shivs11 c6980ad
Carry a worker's session options on its heartbeat
Shivs11 e9c0ac9
Name a multi-session worker's queue after its instance key in BoundWo…
Shivs11 a0628f0
Merge remote-tracking branch 'origin/main' into sticky-activity-sessi…
Shivs11 a5ac2d9
Renumber poll session_options to 13 after main took 12
Shivs11 d555c70
Document how the sticky queue is named for each session admission mode
Shivs11 252a312
Document which polls carry session options for each admission mode
Shivs11 d67ca94
Note that a multi-session worker's sticky queue is named after its in…
Shivs11 d77590e
Flatten BoundWorkerInfo into SessionInfo.worker_queue
Shivs11 877618d
Clarify session option docs
Shivs11 d5ed3f2
Fix comment indentation in WorkerSessionOptions doc
Shivs11 eecc818
Keep only the exclusive-worker bit in SessionInfo
Shivs11 f616960
Trim SessionInfo doc
Shivs11 89f0f12
Address review: service wording, sticky queue note, SessionInfo doc, …
Shivs11 528579f
Merge remote-tracking branch 'origin/main' into shivam/885-one-pr
Shivs11 a045f66
Reword stable_identity note
Shivs11 5dae7e5
Record the bound worker's queue in SessionInfo (#927)
Shivs11 779f3f7
Add WORKFLOW_TASK_FAILED_CAUSE_SESSION_WORKER_REQUIRED
Shivs11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package temporal.api.session.v1; | ||
|
|
||
| option go_package = "go.temporal.io/api/session/v1;session"; | ||
| option java_package = "io.temporal.api.session.v1"; | ||
| option java_multiple_files = true; | ||
| option java_outer_classname = "MessageProto"; | ||
| option ruby_package = "Temporalio::Api::Session::V1"; | ||
| option csharp_namespace = "Temporalio.Api.Session.V1"; | ||
|
|
||
| import "google/protobuf/empty.proto"; | ||
|
|
||
| // EXPERIMENTAL. Subject to redesign or removal. | ||
| // Sent on workflow and activity polls. Presence means this worker can service | ||
| // sessions. Currently, the only supported Session type is Workflow Session | ||
| // (aka Workflow-as-Session). A Workflow that is bound to a worker servicing sessions | ||
| // can receive both workflow tasks and activity tasks of an execution. | ||
| // | ||
| // The server routes a session's work to the worker's sticky queue, so the | ||
| // sticky queue name depends on the admission mode: | ||
| // * single_session: the worker polls only its sticky queue, named after | ||
| // SingleSessionOptions.stable_identity. | ||
| // * multi_session: the worker polls the normal queue and its sticky queue, | ||
| // named after the poll's worker_instance_key. | ||
| // The server rejects sticky polls whose name does not follow this rule. | ||
| message WorkerSessionOptions { | ||
| // Admission control. Required: exactly one mode must be set, and the | ||
| // server rejects session options with neither. | ||
| oneof admission { | ||
| // If specified, the worker only polls for work belonging to its session. | ||
| SingleSessionOptions single_session = 1; | ||
| // If specified, the worker can service multiple sessions at once. | ||
| MultiSessionOptions multi_session = 2; | ||
| } | ||
| } | ||
|
|
||
| // EXPERIMENTAL. Subject to redesign or removal. | ||
| // Service exactly one session for the worker's lifetime, including across | ||
| // process restarts with the same stable_identity. The first workflow this | ||
| // worker picks up is bound to it, and from then on the worker only receives | ||
| // that workflow's tasks, even after the workflow completes. | ||
| message SingleSessionOptions { | ||
| // Identity the binding is stored under. Required; must be non-empty. | ||
| // Reuse it across restarts of the same session, not across concurrently | ||
| // running workers. If multiple workers poll with the same stable_identity | ||
| // concurrently, the server treats them as pollers of a single worker and | ||
| // process affinity is lost. | ||
| // | ||
| // Note: this is the name of the worker's sticky queue, specified by the user. | ||
| // Note: we are currently unsure how this will evolve. May be deprecated as | ||
| // the session model develops. | ||
| string stable_identity = 1; | ||
| } | ||
|
|
||
| // EXPERIMENTAL. Subject to redesign or removal. | ||
| // Service any number of sessions concurrently. Future admission knobs (e.g. | ||
| // session slots) belong here. | ||
| message MultiSessionOptions { | ||
| } | ||
|
|
||
| // EXPERIMENTAL. Subject to redesign or removal. | ||
| // Resolved activity placement. Unset = normal task-queue routing. | ||
| message ActivitySessionOptions { | ||
|
Shivs11 marked this conversation as resolved.
Resolved
|
||
| oneof placement { | ||
| // Run in the workflow's current session (on its sticky queue). | ||
| // Currently requires the activity's task queue to be the workflow's, | ||
| // and the workflow's worker to service sessions. | ||
| google.protobuf.Empty workflow_session = 1; | ||
|
|
||
| // Future: references to other types of sessions. | ||
| } | ||
| } | ||
|
|
||
| // EXPERIMENTAL. Subject to redesign or removal. | ||
| // How a workflow is bound to a worker. | ||
| message SessionInfo { | ||
| // True when the workflow is bound to a single-session worker. Such a | ||
| // binding never moves to another worker. | ||
| bool exclusive_worker = 1; | ||
| // The sticky queue of the worker the workflow is bound to: the stable | ||
| // identity of a single-session worker, or the worker instance key of a | ||
| // multi-session worker. History has no other record of it, so the server | ||
| // needs it to restore the binding when it rebuilds the workflow from | ||
| // history. Always set. | ||
| string worker_queue = 2; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.