temporalio / temporalio/temporal
Updater.addWorkflowTaskToMatching may be missing NotFound logging and build-ID assignment handling present in pushWorkflowTask
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.2k
- Forks
- 1.9k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 228
Description
Expected Behavior
When a workflow task is added to matching via
Updater.addWorkflowTaskToMatching (used by Update-with-Start's
speculative WFT path), it should behave consistently with
pushWorkflowTask (used by the transfer queue active task
executor) for the same matchingClient.AddWorkflowTask call —
specifically:
- Logging when matching unexpectedly returns a NotFound error
- Updating the workflow's assigned build ID via
initializeWorkflowAssignedBuildIdwhen assignment rules are in use
Actual Behavior
addWorkflowTaskToMatching (service/history/api/updateworkflow/api.go:317)
builds the same AddWorkflowTaskRequest and calls
matchingClient.AddWorkflowTask, but returns immediately on
success without:
- Logging if a NotFound error is unexpectedly returned
(pushWorkflowTask logs this case explicitly, since it's
not expected for AddTasks calls) - Calling
initializeWorkflowAssignedBuildIdto persist the
assigned build ID returned in the response, when
directive.GetUseAssignmentRules()is set
A TODO comment at the call site acknowledges this code was
copied from transferQueueActiveTaskExecutor.processWorkflowTask
and should be extracted into a shared helper, but the extraction
was never completed — leaving this functional gap.
This may mean worker build-ID assignment is not tracked
correctly for workflow tasks added via the Update-with-Start
speculative WFT path, though I have not yet confirmed user-visible
impact.
Steps to Reproduce the Problem
- Compare service/history/api/updateworkflow/api.go:317
(addWorkflowTaskToMatching) against
service/history/transfer_queue_task_executor_base.go:147
(pushWorkflowTask) — both construct the same
AddWorkflowTaskRequest and call matchingClient.AddWorkflowTask - Note that pushWorkflowTask additionally logs on NotFound
and calls initializeWorkflowAssignedBuildId(...) on success
when assignment rules are in use - Observe that addWorkflowTaskToMatching has neither behavior,
returning nil immediately after a successful matching call
Specifications
- Version: present on latest main
- Platform: any
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing addWorkflowTaskToMatching in service/history/api/updateworkflow/api.go with pushWorkflowTask in service/history/transfer_queue_task_executor_base.go. Trace the matchingClient.AddWorkflowTask response and the existing initializeWorkflowAssignedBuildId call; done means the speculative WFT path handles unexpected NotFound results and assigned build IDs consistently with pushWorkflowTask.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100