Fix backlinks in Signal[WithStart]Workflow when called from workflows#10362
Fix backlinks in Signal[WithStart]Workflow when called from workflows#10362chrsmith wants to merge 2 commits into
Conversation
e67c46a to
055ee89
Compare
bergundy
left a comment
There was a problem hiding this comment.
This LGTM but can you please verify all of these cases via tests?
- Send a signal-with-start request, no existing workflow, get back a link and the mapping is resolved to an event that is not buffered.
- Send a signal-with-start request, existing workflow, no running workflow task, get back a link and the mapping is resolved to an event that is not buffered.
- Send a signal-with-start request, existing workflow, running workflow task, get back a link and the mapping is resolved to an event that is buffered, complete the workflow task, and verify that the mapping is resolved to an event that is not buffered.
To simulate a running workflow task send the request between PollWorkflowTaskQueue and RespondWorkflowTaskCompleted.
28751da to
c266bf4
Compare
c266bf4 to
f2e575d
Compare
|
@bergundy , @long-nt-tran PTAL. After chatting with you folks, I just did some refactoring and reused the existing test scenarios we had in So the refactoring went like this: 1.) Introduce a new New surface area: 2.) Refactor the relevant tests to use that new piece of infrastructure. And then for each of those tests, create a -- PASS: TestLinksTestSuite (0.00s)
--- PASS: TestLinksTestSuite/TestSignalWorkflowExecution_LinksAttachedToEvent (0.12s)
--- PASS: TestLinksTestSuite/TestTerminateWorkflow_LinksAttachedToEvent (0.13s)
--- PASS: TestLinksTestSuite/TestSignalWithStartWorkflowExecution_LinksAttachedToRelevantEvents (0.13s)
- ^--- existing test using SignalWithStart, kept as-is.
+ --- PASS: TestLinksTestSuite/TestSignalWithStartWorkflowExecution_LinksAttachedToEvent (0.00s)
+ --- PASS: TestLinksTestSuite/TestSignalWithStartWorkflowExecution_LinksAttachedToEvent/SignalStartsNewWorkflow (0.13s)
+ --- PASS: TestLinksTestSuite/TestSignalWithStartWorkflowExecution_LinksAttachedToEvent/SignalExistingWorkflow (0.13s)
--- PASS: TestLinksTestSuite/TestRequestCancelWorkflow_LinksAttachedToEvent (0.13s)
+ --- PASS: TestLinksTestSuite/TestSignalWithStartWorkflowExecution_BufferedDuringWorkflowTask (0.00s)
+ --- PASS: TestLinksTestSuite/TestSignalWithStartWorkflowExecution_BufferedDuringWorkflowTask/SignalStartsNewWorkflow (0.12s)
+ --- PASS: TestLinksTestSuite/TestSignalWithStartWorkflowExecution_BufferedDuringWorkflowTask/SignalExistingWorkflow (0.13s)
--- PASS: TestLinksTestSuite/TestSignalWorkflowExecution_BufferedDuringWorkflowTask (0.13s)
+ --- PASS: TestLinksTestSuite/TestSignalWithStartWorkflowExecution_BacklinkSurvivesReset (0.00s)
+ --- PASS: TestLinksTestSuite/TestSignalWithStartWorkflowExecution_BacklinkSurvivesReset/SignalExistingWorkflow (0.14s)
+ --- PASS: TestLinksTestSuite/TestSignalWithStartWorkflowExecution_BacklinkSurvivesReset/SignalStartsNewWorkflow (0.14s)
--- PASS: TestLinksTestSuite/TestSignalWorkflowExecution_BacklinkSurvivesReset (0.14s)``` |
c737a58 to
ffb4b67
Compare
ffb4b67 to
06c72ca
Compare
|
As it turns out I was calling Unfortunately making an SDK Anyways However, there were a couple of quirks with the new
|
What changed?
Story time!
@spkane31 added support for durable calls to
SignalWithStartby using Nexus (Implement SignalWithStart as a system nexus endpoint #9833)@bergundy pointed out an issue, about how backlinks wouldn't be persisted between the signaler and target workflow. (Implement SignalWithStart as a system nexus endpoint #9833 (comment))
@long-nt-tran appears to have already added support for that
(Propagate backlinks on Signal and Signal-with-Start responses #9897)
This PR just adds the final step, and adds tests for verifying
SignalWithStartcalls are linked correctly.The only functional changes are in
chasm/lib/workflow/nexus_service.go:SignalLinkproperty inworkflowservice.SignalWithStartWorkflowExecutionResponse. We now do.commonpb.Linkrather than using theSignalLinkreturned from the History service's response. I'm assuming trusting the History service is returning a validSignalLinkof theLink_WorkflowEventvariant. (Whether it is aEventIDorRequestIDRefis immaterial.)Why?
Fixes a gap in the new codepath for calls to
SignalWithStartadds tests.Questions
s.Equal(int64(3), gotReqInfo.GetEventId())How did you test it?
Potential risks
I do not know. Please be on the lookout for bad assumptions!