Commit c307cb5
authored
Fix corruption during CONFLICT upload (#3499)
* Fix corruption during CONFLICT upload
PBENCH-1219
b0.72 ARCHIVE server version
Large uploads can time out, causing the client (e.g., the 0.69 passthrough
server's dispatch) to retry. Eventually, this will result in an `OK` (200)
response, which is good. However if we retry before the original operation
finishes (it may be still running, despite the client timeout), we catch the
already existing "temporary intake directory" as a `CONFLICT` error.
Unfortunately, the cleanup logic doesn't recognize this distinction, and still
deleted the intake directory on exit. Timed correctly, this could break the
original upload: at best, it results in a noisy termination with complaints
that the existed temporary directory no longer exists.
Fix this problem by attempting to delete only when this API instance has
successfully created the temporary directory. Modify the `CONFLICT` unit test
case to reproduce the situation more accurately and additionally validate that
the directory still exists after completion.1 parent f8fb65d commit c307cb5
File tree
2 files changed
+34
-16
lines changed- lib/pbench
- server/api/resources
- test/unit/server
2 files changed
+34
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
523 | 525 | | |
524 | 526 | | |
525 | 527 | | |
526 | | - | |
| 528 | + | |
527 | 529 | | |
528 | | - | |
| 530 | + | |
529 | 531 | | |
530 | 532 | | |
531 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
292 | 301 | | |
| 302 | + | |
293 | 303 | | |
294 | 304 | | |
295 | 305 | | |
296 | 306 | | |
297 | 307 | | |
298 | 308 | | |
299 | | - | |
300 | | - | |
301 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
302 | 313 | | |
| 314 | + | |
303 | 315 | | |
304 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
305 | 319 | | |
306 | 320 | | |
307 | 321 | | |
| |||
317 | 331 | | |
318 | 332 | | |
319 | 333 | | |
320 | | - | |
321 | | - | |
322 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
323 | 339 | | |
324 | 340 | | |
325 | 341 | | |
| |||
0 commit comments