Commit 2734819
committed
fix(connectors): make the sync-log sweep aware of a live run's heartbeat
Review round 6 on #6909, plus a consistency pass over the whole branch.
The sweep keys on the log row's startedAt, and the heartbeat added earlier in
this PR refreshes the connector's updatedAt — the log table has no equivalent,
so nothing refreshed what the sweep reads. A legitimately long in-process sync
kept its connector lock exactly as designed while its log row was closed as
failed at the TTL, and completeSyncLog's started guard then no-opped when the
run finished. A successful sync was recorded permanently as a failure and its
counters were lost to the listing-safety check.
Neither round was wrong alone; the combination was. The sweep now spares a row
whose id is still the connector's lock token, reusing the ownership mechanism
rather than adding another. Every orphan still drains: a reclaimed run's token
is cleared, a replaced run's token belongs to its successor, and rows predating
the column have none.
Five documentation claims that later rounds falsified are corrected, including
the sweep's own rationale, which still argued the platform kills every run at
the duration ceiling — the reasoning the heartbeat exists because it does not
hold for the in-process path.
applySupersededOutcome's boolean parameter was vestigial: both call sites passed
false and a test asserted the dead branch. Simplified.1 parent 4e1dc16 commit 2734819
2 files changed
Lines changed: 56 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
216 | 240 | | |
217 | 241 | | |
218 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
34 | 57 | | |
35 | 58 | | |
36 | 59 | | |
| |||
117 | 140 | | |
118 | 141 | | |
119 | 142 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
126 | 150 | | |
127 | 151 | | |
128 | 152 | | |
| |||
134 | 158 | | |
135 | 159 | | |
136 | 160 | | |
137 | | - | |
| 161 | + | |
| 162 | + | |
138 | 163 | | |
139 | 164 | | |
140 | 165 | | |
| |||
0 commit comments