Skip to content

Commit

Permalink
Fix NPE in archival signal sending (cadence-workflow#1827)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjdawson2016 authored May 10, 2019
1 parent d12a089 commit a9f353f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions service/worker/archiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,10 @@ func (c *client) Archive(request *ArchiveRequest) error {
DecisionTaskStartToCloseTimeout: workflowTaskStartToCloseTimeout,
WorkflowIDReusePolicy: cclient.WorkflowIDReusePolicyAllowDuplicate,
}
exec, err := c.cadenceClient.SignalWithStartWorkflow(context.Background(), workflowID, signalName, *request, workflowOptions, archivalWorkflowFnName, nil)
_, err := c.cadenceClient.SignalWithStartWorkflow(context.Background(), workflowID, signalName, *request, workflowOptions, archivalWorkflowFnName, nil)
if err != nil {
tagLoggerWithRequest(c.logger, *request).WithTags(tag.Error(err),
tag.WorkflowID(exec.ID),
tag.WorkflowRunID(exec.RunID),
).Error("failed to SignalWithStartWorkflow to archival system workflow")
taggedLogger := tagLoggerWithRequest(c.logger, *request).WithTags(tag.WorkflowID(workflowID), tag.Error(err))
taggedLogger.Error("failed to send signal to archival system workflow")
c.metricsClient.IncCounter(metrics.ArchiverClientScope, metrics.CadenceFailures)
}
return err
Expand Down
6 changes: 3 additions & 3 deletions service/worker/archiver/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ func hashesEqual(a []uint64, b []uint64) bool {
func tagLoggerWithRequest(logger log.Logger, request ArchiveRequest) log.Logger {
return logger.WithTags(
tag.ShardID(request.ShardID),
tag.WorkflowDomainID(request.DomainID),
tag.WorkflowID(request.WorkflowID),
tag.WorkflowRunID(request.RunID),
tag.ArchivalRequestDomainID(request.DomainID),
tag.ArchivalRequestWorkflowID(request.WorkflowID),
tag.ArchivalRequestRunID(request.RunID),
tag.ArchivalRequestEventStoreVersion(request.EventStoreVersion),
tag.ArchivalRequestBranchToken(request.BranchToken),
tag.ArchivalRequestNextEventID(request.NextEventID),
Expand Down

0 comments on commit a9f353f

Please sign in to comment.