fix(daemon): open the task log before the workflow-identity check so its parks are logged
deploy / plan (push) Successful in 6s
deploy / gate (push) Successful in 8m37s
deploy / agent-image (push) Successful in 23s
deploy / dist-zip (push) Skipped
deploy / archied-image (push) Successful in 2m4s

This commit is contained in:
sam committed 2026-11-09 13:55:19 +11:00
1 parent dc2c3b983f
commit 4b0adac674
1 file changed
+3 -1
+3 -1
View File
@@ -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