Commit 08a50d7
committed
fix(run-engine,webapp): harden the pause sweep retry and report it honestly
Guard the pass count against non-finite input. Math.max(1, NaN) is NaN, so a
NaN maxPasses skipped the loop entirely and reported a successful no-op sweep,
and Infinity spun at one pass per 50ms inside an awaited request. The count is
now clamped to a ceiling and falls back to the default when it is not finite.
Retry a pass that errored, not just one that skipped. Rejected script calls
never increment skipped, so a transient Redis failure part-way through a batch
ended the sweep with those runs still admitted and still on the worker queue —
the exact outcome the sweep exists to prevent — while the result read as a
success with a non-zero error count nobody was gated on.
Rename the residual count to skippedLastPass. It is the final pass's value
rather than a total, and it conflates a run a worker claimed first (which
escaped the pause and is executing) with a leaked concurrency slot that has no
worker queue entry behind it. The name and its doc comment now say so instead
of implying it partitions the candidate set alongside returned.
Tests: pin the non-finite pass-count guard, cover that an acknowledged run is
never resurrected by a later sweep, and stop the worker queue override test
leaking its environment variable if the queue constructor throws.1 parent 6cdf287 commit 08a50d7
5 files changed
Lines changed: 328 additions & 28 deletions
File tree
- apps/webapp/test
- internal-packages/run-engine/src
- engine
- run-queue
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
1648 | 1648 | | |
1649 | 1649 | | |
1650 | 1650 | | |
1651 | | - | |
| 1651 | + | |
1652 | 1652 | | |
1653 | 1653 | | |
1654 | 1654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
143 | 153 | | |
| 154 | + | |
144 | 155 | | |
145 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
146 | 162 | | |
147 | 163 | | |
148 | 164 | | |
| |||
1058 | 1074 | | |
1059 | 1075 | | |
1060 | 1076 | | |
1061 | | - | |
1062 | | - | |
| 1077 | + | |
| 1078 | + | |
1063 | 1079 | | |
1064 | 1080 | | |
1065 | 1081 | | |
| |||
1068 | 1084 | | |
1069 | 1085 | | |
1070 | 1086 | | |
1071 | | - | |
1072 | | - | |
| 1087 | + | |
| 1088 | + | |
1073 | 1089 | | |
1074 | 1090 | | |
1075 | 1091 | | |
| |||
1080 | 1096 | | |
1081 | 1097 | | |
1082 | 1098 | | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
1083 | 1102 | | |
1084 | | - | |
1085 | | - | |
| 1103 | + | |
| 1104 | + | |
1086 | 1105 | | |
1087 | 1106 | | |
1088 | 1107 | | |
1089 | | - | |
| 1108 | + | |
1090 | 1109 | | |
1091 | 1110 | | |
1092 | 1111 | | |
1093 | 1112 | | |
1094 | | - | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
1095 | 1116 | | |
1096 | | - | |
| 1117 | + | |
1097 | 1118 | | |
1098 | | - | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
1099 | 1122 | | |
1100 | 1123 | | |
1101 | 1124 | | |
1102 | 1125 | | |
1103 | 1126 | | |
1104 | 1127 | | |
| 1128 | + | |
| 1129 | + | |
1105 | 1130 | | |
1106 | | - | |
| 1131 | + | |
1107 | 1132 | | |
1108 | 1133 | | |
1109 | 1134 | | |
| |||
1112 | 1137 | | |
1113 | 1138 | | |
1114 | 1139 | | |
1115 | | - | |
| 1140 | + | |
1116 | 1141 | | |
1117 | 1142 | | |
1118 | 1143 | | |
1119 | 1144 | | |
1120 | | - | |
| 1145 | + | |
1121 | 1146 | | |
1122 | 1147 | | |
1123 | 1148 | | |
| |||
1129 | 1154 | | |
1130 | 1155 | | |
1131 | 1156 | | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
1132 | 1163 | | |
1133 | 1164 | | |
1134 | 1165 | | |
1135 | | - | |
| 1166 | + | |
1136 | 1167 | | |
1137 | 1168 | | |
1138 | 1169 | | |
1139 | 1170 | | |
1140 | 1171 | | |
1141 | 1172 | | |
1142 | | - | |
| 1173 | + | |
1143 | 1174 | | |
1144 | 1175 | | |
1145 | 1176 | | |
1146 | 1177 | | |
1147 | 1178 | | |
1148 | 1179 | | |
1149 | 1180 | | |
1150 | | - | |
| 1181 | + | |
1151 | 1182 | | |
1152 | 1183 | | |
1153 | 1184 | | |
| |||
1171 | 1202 | | |
1172 | 1203 | | |
1173 | 1204 | | |
1174 | | - | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
1175 | 1209 | | |
1176 | 1210 | | |
1177 | 1211 | | |
1178 | 1212 | | |
1179 | 1213 | | |
1180 | 1214 | | |
1181 | | - | |
| 1215 | + | |
1182 | 1216 | | |
1183 | 1217 | | |
1184 | 1218 | | |
| |||
0 commit comments