From 4b0adac674ba021250ff645988dffa73c489d5ad Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Mon, 9 Nov 2026 13:55:19 +1100 Subject: [PATCH] fix(daemon): open the task log before the workflow-identity check so its parks are logged --- internal/daemon/daemon.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/daemon/daemon.go b/internal/daemon/daemon.go index 5bed71434..7c8de19c7 100644 --- a/internal/daemon/daemon.go +++ b/internal/daemon/daemon.go @@ -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