Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printf-style debug of where workflow startup error go during queries... #932

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/internal_event_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ func (wc *workflowEnvironmentImpl) WorkflowInfo() *WorkflowInfo {
}

func (wc *workflowEnvironmentImpl) Complete(result *commonpb.Payloads, err error) {
fmt.Printf("YYY %+v\n", err)
wc.completeHandler(result, err)
}

Expand Down
14 changes: 14 additions & 0 deletions internal/internal_task_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ func (w *workflowExecutionContextImpl) getEventHandler() *workflowExecutionEvent
}

func (w *workflowExecutionContextImpl) completeWorkflow(result *commonpb.Payloads, err error) {
fmt.Printf("ZZZ %+v\n", err)

w.isWorkflowCompleted = true
w.result = result
w.err = err
Expand Down Expand Up @@ -794,6 +796,18 @@ processWorkflowLoop:
break processWorkflowLoop
}
}

if workflowContext.err != nil {
wth.logger.Warn("Workflow context held error after processing.",
tagWorkflowType, task.WorkflowType.GetName(),
tagWorkflowID, workflowID,
tagRunID, runID,
tagAttempt, task.Attempt,
tagPreviousStartedEventID, task.GetPreviousStartedEventId(),
tagError, workflowContext.err,
)
}

errRet = err
completeRequest = response
return
Expand Down
2 changes: 2 additions & 0 deletions internal/internal_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ func (d *syncWorkflowDefinition) Execute(env WorkflowEnvironment, header *common

// TODO: @shreyassrivatsan - add workflow trace span here
r.workflowResult, r.error = d.workflow.Execute(d.rootCtx, input)
fmt.Printf("HERE %+v\n", r.error)
rpp := getWorkflowResultPointerPointer(ctx)
*rpp = r
})
Expand Down Expand Up @@ -677,6 +678,7 @@ func executeDispatcher(ctx Context, dispatcher dispatcher, timeout time.Duration
env.GetLogger().Info("Workflow has unhandled signals", "SignalNames", us)
}

fmt.Printf("XXX %+v\n", rp.error)
env.Complete(rp.workflowResult, rp.error)
}

Expand Down