Commit c4f740f
committed
Propagate step exit description from FlowJob to JobExecution
Issue: gh-3740
When a step inside a FlowJob fails, the StepExecution's exit status
already contains the failure description (typically the stack trace
recorded by AbstractStep). However, JobFlowExecutor.executeStep only
returned the exit code, and the final JobFlowExecutor.updateJobExecutionStatus
combined the executor's tracked ExitStatus (which had no description)
with an ExitStatus built from the FlowExecutionStatus name. As a result
the step's exit description was discarded and the JobExecution ended
with an empty exit description, in contrast to SimpleJob which assigns
stepExecution.getExitStatus() directly.
Accumulate the step's exit description into the executor's tracked
ExitStatus in executeStep so it survives the final
updateJobExecutionStatus call. ExitStatus.addExitDescription already
deduplicates equal descriptions and concatenates distinct ones with a
semicolon, so multiple step failures along a flow path are preserved
without duplication.
Signed-off-by: Seonwoo Jung <laborlawseon@kap.kr>1 parent d8447d8 commit c4f740f
3 files changed
Lines changed: 38 additions & 2 deletions
File tree
- spring-batch-core/src
- main/java/org/springframework/batch/core/job/flow
- test/java/org/springframework/batch/core/job/flow
- spring-batch-integration/src/test/java/org/springframework/batch/integration/step
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
| |||
Lines changed: 31 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
94 | 124 | | |
95 | 125 | | |
96 | 126 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
0 commit comments