Skip to content
Draft
Show file tree
Hide file tree
Changes from 7 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
5 changes: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ Before starting the implementation or review of any request, you MUST REVIEW the
- 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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

just something that i observed an agent do :)


- Keep receiver methods in their existing implementation files and unit tests in the corresponding owner test files. Do not create feature files that mix methods or test suites from unrelated owners.
- Use getter methods for reads whenever available, including protobuf fields. Use direct field access for assignments.

## Development Workflow

1. Inspect surrounding code, tests, and configuration before making changes.
Expand Down
35 changes: 24 additions & 11 deletions api/historyservice/v1/request_response.pb.go

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

19 changes: 15 additions & 4 deletions api/persistence/v1/executions.pb.go

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

28 changes: 21 additions & 7 deletions api/persistence/v1/tasks.pb.go

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

2 changes: 2 additions & 0 deletions client/matching/client_gen.go

@Shivs11 Shivs11 Oct 28, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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)

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

22 changes: 20 additions & 2 deletions client/matching/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ import (
"time"

"github.com/stretchr/testify/require"
deploymentpb "go.temporal.io/api/deployment/v1"
enumspb "go.temporal.io/api/enums/v1"
"go.temporal.io/api/serviceerror"
sessionpb "go.temporal.io/api/session/v1"
taskqueuepb "go.temporal.io/api/taskqueue/v1"
"go.temporal.io/api/workflowservice/v1"
"go.temporal.io/server/api/matchingservice/v1"
"go.temporal.io/server/api/matchingservicemock/v1"
taskqueuespb "go.temporal.io/server/api/taskqueue/v1"
"go.temporal.io/server/common/dynamicconfig"
"go.temporal.io/server/common/log"
"go.temporal.io/server/common/testing/protorequire"
"go.temporal.io/server/common/tqid"
"go.uber.org/mock/gomock"
"google.golang.org/grpc"
Expand Down Expand Up @@ -238,23 +241,38 @@ func TestDoPollWorkflowTaskQueue_LoadBalancedRoot(t *testing.T) {
client := newTestClient(cache, loadBalancer)
request := &matchingservice.PollWorkflowTaskQueueRequest{
NamespaceId: testNamespaceID,
PollerId: "poller-id",
PollRequest: &workflowservice.PollWorkflowTaskQueueRequest{
TaskQueue: &taskqueuepb.TaskQueue{Name: testTaskQueueName},
Identity: "worker",
SessionOptions: &sessionpb.WorkerSessionOptions{Isolation: &sessionpb.WorkerSessionOptions_SingleSession{
SingleSession: &sessionpb.SingleSessionOptions{StableIdentity: "session-identity"},
}},
DeploymentOptions: &deploymentpb.WorkerDeploymentOptions{
DeploymentName: "deployment", BuildId: "v1", WorkerVersioningMode: enumspb.WORKER_VERSIONING_MODE_VERSIONED,
},
},
Conditions: &matchingservice.PollConditions{NoWait: true},
}
response := &matchingservice.PollWorkflowTaskQueueResponse{}

serviceClient.EXPECT().PollWorkflowTaskQueue(gomock.Any(), gomock.Any()).DoAndReturn(
func(_ context.Context, outgoing *matchingservice.PollWorkflowTaskQueueRequest, _ ...grpc.CallOption) (*matchingservice.PollWorkflowTaskQueueResponse, error) {
func(ctx context.Context, outgoing *matchingservice.PollWorkflowTaskQueueRequest, _ ...grpc.CallOption) (*matchingservice.PollWorkflowTaskQueueResponse, error) {
require.Equal(t, selectedPartition.RpcName(), outgoing.GetPollRequest().GetTaskQueue().GetName())
require.Equal(t, "worker", outgoing.GetPollRequest().GetIdentity())
require.Equal(t, request.GetPollerId(), outgoing.GetPollerId())
protorequire.ProtoEqual(t, request.GetPollRequest().GetSessionOptions(), outgoing.GetPollRequest().GetSessionOptions())
protorequire.ProtoEqual(t, request.GetPollRequest().GetDeploymentOptions(), outgoing.GetPollRequest().GetDeploymentOptions())
protorequire.ProtoEqual(t, request.GetConditions(), outgoing.GetConditions())
outgoingMetadata, ok := metadata.FromOutgoingContext(ctx)
require.True(t, ok)
require.Equal(t, []string{"worker"}, outgoingMetadata.Get("acquisition-trace"))
return response, nil
},
)

actual, err := client.doPollWorkflowTaskQueue(
context.Background(),
metadata.NewOutgoingContext(t.Context(), metadata.Pairs("acquisition-trace", "worker")),
taskQueue.RootPartition(),
true,
PartitionCounts{Read: 4, Write: 4},
Expand Down
Loading
Loading