17
shard historyi.ShardContext,
18
workflowConsistencyChecker api.WorkflowConsistencyChecker,
19
>
) (resp *historyservice.RemoveSignalMutableStateResponse, retError error) {
api.go
20
>
_, err := api.GetActiveNamespace(shard, namespace.ID(req.GetNamespaceId()), req.WorkflowExecution.WorkflowId)
21
>
if err != nil {
22
>
return nil, err
23
>
}
24
25
>
err = api.GetAndUpdateWorkflowWithNew(
api.go
26
>
ctx,
27
>
nil,
28
>
definition.NewWorkflowKey(
29
>
req.NamespaceId,
30
>
req.WorkflowExecution.WorkflowId,
31
>
req.WorkflowExecution.RunId,
32
>
),
33
>
func(workflowLease api.WorkflowLease) (*api.UpdateWorkflowAction, error) {
34
>
mutableState := workflowLease.GetMutableState()
35
>
if !mutableState.IsWorkflowExecutionRunning() {
36
return nil, consts.ErrWorkflowCompleted
37
}
38
39
>
mutableState.DeleteSignalRequested(req.GetRequestId())
api.go
40
>
// This is a no-op if signals are stored in CHASM, since we'll ignore the deletion request,
41
>
// see DeleteSignalRequested implementation.
42
>
// TODO(long-nt-tran): Clean up code once ChasmSignalBacklinksEnabled is fully rolled out.
43
>
return &api.UpdateWorkflowAction{
44
>
Noop: mutableState.ChasmSignalBacklinksEnabled(),
45
>
CreateWorkflowTask: false,
46
>
}, nil
47
},
48
nil,