fix(daemon): open the task log before the workflow-identity check so its parks are logged
This commit is contained in:
1 file changed
+3
-1
@@ -1686,6 +1686,9 @@ func (d *Daemon) process(ctx context.Context, task *workflow.Task, hold *taskHol
|
||||
// A task off the NATS stream only has an id once the store has claimed its
|
||||
// row, inside this call, so its capacity is named here.
|
||||
hold.name(task.ID, task.Attempt)
|
||||
// The log opens before any check that can park, so every park reason
|
||||
// reaches the attempt log.
|
||||
defer d.openTaskLog(task)()
|
||||
// The workflow may name the identity the run acts as, which everything
|
||||
// below is chosen by, so it is settled before anything else.
|
||||
if !d.adoptWorkflowIdentity(ctx, task) {
|
||||
@@ -1694,7 +1697,6 @@ func (d *Daemon) process(ctx context.Context, task *workflow.Task, hold *taskHol
|
||||
// Register first so the task can be stopped during setup.
|
||||
ctx, finished := d.running.begin(ctx, task.ID, task.Identity)
|
||||
defer finished()
|
||||
defer d.openTaskLog(task)()
|
||||
|
||||
if d.parkIfIdentityUnresolvable(ctx, task) {
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user