Commit c0c9a4e
authored
fix: mark push CANCELED when client disconnects mid-push (#217)
## Summary
- Adds an `onDisconnect` callback to `HeartbeatSender` — fires once when
a sideband write throws, indicating the client has gone away
- `StoreAndForwardReceivePackFactory` wires the callback to
`PushStore.cancel()` on the active push record, using
`validationRecordId` (PENDING) if set, otherwise the initial `pushId`
(RECEIVED)
- No sweeper added — a TTL-based approach cannot distinguish abandoned
RECEIVED records from PENDING records legitimately waiting in the
approval queue
closes #214
## Test plan
- [ ] Push to `/push/` path and Ctrl+C mid-way through the approval
wait; confirm push record transitions to CANCELED
- [ ] Normal push (no disconnect) still reaches FORWARDED correctly
- [ ] Unit tests pass: `./gradlew :git-proxy-java-core:test`4 files changed
Lines changed: 43 additions & 8 deletions
File tree
- git-proxy-java-core/src/main/java/org/finos/gitproxy/git
- git-proxy-java-dashboard/src/main/java/org/finos/gitproxy/dashboard/controller
- test
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | | - | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
40 | 48 | | |
41 | 49 | | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| |||
61 | 70 | | |
62 | 71 | | |
63 | 72 | | |
64 | | - | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
68 | 83 | | |
69 | 84 | | |
70 | 85 | | |
| |||
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
260 | 278 | | |
261 | 279 | | |
262 | 280 | | |
| |||
275 | 293 | | |
276 | 294 | | |
277 | 295 | | |
| 296 | + | |
278 | 297 | | |
279 | 298 | | |
280 | | - | |
| 299 | + | |
281 | 300 | | |
282 | 301 | | |
283 | 302 | | |
| |||
git-proxy-java-dashboard/src/main/java/org/finos/gitproxy/dashboard/controller/PushController.java
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
| 215 | + | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| |||
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
228 | | - | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
0 commit comments