Repository navigation
Conversation
Serialize initial polls for the same stable identity, then serve the assigned sticky queue locally. Reuse existing backlog forwarding and retain the first backlog notification while the sticky queue initializes. Keep receiver methods and tests in their owning files, preserve review comments, and document that acquisition failure recovery remains outside this POC.
| - Update API proto: `make update-go-api` | ||
| - Always include `-tags test_dep` when running tests. Include the `integration` tag only for integration tests. | ||
|
|
||
| ## Code Conventions |
There was a problem hiding this comment.
just something that i observed an agent do :)
There was a problem hiding this comment.
the main change that i have added over here is that i have allowed sessionOptions to be sendable on matching poll RPC's for the sole purpose of being able to send the first sticky session poll to a normal task queue partition (and use matching's load balancing)
|
|
||
| // Create corresponding WorkflowTaskScheduled event for speculative WT. | ||
| // Transient and speculative tasks need a scheduled event before their timeout is recorded. | ||
| if workflowTask.Type == enumsspb.WORKFLOW_TASK_TYPE_SPECULATIVE || m.ms.IsTransientWorkflowTask() { |
There was a problem hiding this comment.
this can be debatable but the main reason why this has been added is because now, for session based s2s timeouts, we want to not clear stickiness and just place the task back on the sticky task queue. Earlier, for non session based tasks, we were clearing the stickiness of these tasks and then having transient tasks being picked up from the normal task queue without any s2s timeouts. That changes here imo
ShahabT
left a comment
There was a problem hiding this comment.
Reviewed all history side and half of matching side. Thanks for the great work, and sorry for the big list of comments! this is a big change, hence these is much to comment :)
Store the binding policy and stable destination together, keep the sticky destination synchronized, and reuse a cloned session state in query responses. Stop creating schedule-to-start timers for ordinary exclusive workflow tasks while preserving speculative task recovery. Align Matching assignment names and simplify metadata expiry without duplicating assignment fields. Update unit and server tests. Acquisition-error, versioning, and offline-query follow-ups remain deferred.
Preserve matcher-owned acquisition and exclusive-worker validation while incorporating internal activity session state and updated sticky activity routing. Regenerate the combined persistence protobufs.
What changed?
Adds initial server support for keeping one AgentCore session dedicated to one workflow execution. Builds on #12630.
Why?
An AgentCore run needs to keep its own session even when its worker stops and is later replaced. Spare worker capacity should not cause that session to pick up another run.
How did you test it?
tests/single_session_taskpoller_test.goand then ran the existing suites.Pending work and limits
This is an initial happy-path POC for review. The following needs more pondering upon honestly:
Suggested review order
This PR is stacked on #12630.
db.go, and queue-record retention.RecordWorkflowTaskStarted, mutable-state sticky setters/reset paths, completion/failure/timeouts, and task routing.task_queue_partition_manager.go; direct initial polling and assignment methods inphysical_task_queue_manager.go; the shared request builder inpri_forwarder.go; and assignment persistence indb.go. An empty forwarding source lets the Matching client choose a normal read partition, while the generated client copy preserves session options. Ordinary sticky forwarding remains unchanged. The shared backlog callback still preserves notices received during queue initialization.tests/single_session_taskpoller_test.go. Read generated files last.