fix(codepipeline): synchronize action abandonment with registration (#7634)

StopPipelineExecution traversed the action list while a worker could append
to it under the execution monitor. Use the same monitor for abandonment
so a concurrent registration cannot invalidate the traversal.

Add a deterministic public-handler regression that registers an action
while the stop waits and verifies that only in-progress actions are abandoned.

Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
This commit is contained in:
Jackson Price authored and GitHub committed 2026-11-06 08:30:39 -04:00
1 parent cf96dadfd9
commit cdcb79a832
2 files changed
+55 -6

No files matched your search

@@ -660,12 +660,14 @@ public class CodePipelineService {
execution.getStageExecutionStatuses().put(execution.getCurrentStage(), "Stopping");
}
if (execution.isAbandon()) {
execution.getActionExecutions().stream()
.filter(a -> "InProgress".equals(a.getStatus()))
.forEach(a -> {
a.setStatus("Abandoned");
a.setLastUpdateTime(now());
});
synchronized (execution) {
execution.getActionExecutions().stream()
.filter(a -> "InProgress".equals(a.getStatus()))
.forEach(a -> {
a.setStatus("Abandoned");
a.setLastUpdateTime(now());
});
}
}
putExecution(execution);
eventPublisher.pipelineStateChange(execution, "STOPPING");