Closed dandavison closed 2 months ago
Handling the remaining activations in the test so that panic doesn't happen would be good
@Sushisource I've done that in https://github.com/temporalio/sdk-core/pull/700/commits/03e65364c44df66e89d62fb87174d5288125b5da, but not in a very satisfying way:
// There is an activation containing a RemoveFromCache job left unhandled
replay_worker.poll_workflow_activation().await.unwrap();
This may be unimportant details but while I'm learning core: is it obvious to you why there's an activation left consisting of [RemoveFromCache]
when we complete the post-reset workflow execution, but there wasn't earlier in the test, when we completed the pre-reset workflow execution, or indeed in your pre-existing test update_workflow
?
I thought perhaps the [RemoveFromJob]
activation would be added every time we complete an activation with a CompleteWorkflowExecution
command, in which case I could have dealt with it at that point, but that doesn't seem to be the case.
This PR adds handling for the new
WorkflowExecutionUpdateAdmitted
event ("UAdm") that the server is going to start sending for reapplied updates (i.e. after reset / conflict resolution).If the server does request an update by sending the new event type, then:
WorkflowExecutionUpdateAccepted
event ("UAcc") without the request payload.Implementation notes
During non-replay, the server may send
UAdm
: in this case we create the corresponding protocol message so that the validator and handler are executed.If we encounter a
UAdm
event during replay then we also create the protocol message, but hold it to one side until we find out whether the update was accepted or not.When handling a
UAcc
event during replay we first look to see if we have aUAdm
protocol message held to one side for us; if we do then we use that, since that has the request payload and in this situation theUAcc
event will not have the payload.If an update has no
UAdm
events then the new implementation reduces to the previous implementation: i.e. we respond to protocol messages received during non-replay, and we respond toUAcc
during replay by creating the protocol message.How this was tested
This samples-python script against this WIP server branch