Skip to content

Commit 3f50b28

Browse files
rkannan82claude
andcommitted
Clean up comments in cancel-on-close paths
- Remove unnecessary partial-generation comment from GenerateActivityCancelCommandsForClose. - Simplify comment in TerminateWorkflow, add matching comment in TimeoutWorkflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0c24be7 commit 3f50b28

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

service/history/workflow/mutable_state_impl.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4615,8 +4615,6 @@ func (ms *MutableStateImpl) GenerateActivityCancelCommandsForClose() error {
46154615
)
46164616
}
46174617

4618-
// Best-effort: if one queue fails, earlier queues may already have tasks generated.
4619-
// This is acceptable because the workflow is being closed regardless.
46204618
for controlQueue, commands := range commandsByQueue {
46214619
if err := ms.AddWorkerCommandsTasks(commands, controlQueue); err != nil {
46224620
return err

service/history/workflow/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ func TimeoutWorkflow(
9999
return err
100100
}
101101

102+
// Proactively cancel in-flight activities so they don't run uselessly after the workflow is closed.
102103
return mutableState.GenerateActivityCancelCommandsForClose()
103104
}
104105

@@ -150,8 +151,7 @@ func TerminateWorkflow(
150151
return err
151152
}
152153

153-
// Proactively cancel in-flight activities by dispatching worker commands to workers
154-
// that support control queues, so they don't run uselessly after the workflow is closed.
154+
// Proactively cancel in-flight activities so they don't run uselessly after the workflow is closed.
155155
return mutableState.GenerateActivityCancelCommandsForClose()
156156
}
157157

0 commit comments

Comments
 (0)