Commit 656eccb
fix: fail fast on insufficient disk space instead of retry loop
When a download fails with CURLE_WRITE_ERROR (code 23) due to disk
full, the retry logic would delete the partial file and restart from
zero — repeating indefinitely and wasting bandwidth.
This adds:
- Pre-flight disk space check before downloading, comparing available
space against total download size
- Detection of CURLE_WRITE_ERROR + low disk as a fatal (non-retryable)
condition with a clear error message
- disk_full flag on DownloadResult to short-circuit the retry loop
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent a2e6a8a commit 656eccb
File tree
3 files changed
+46
-1
lines changed- src/cpp
- include/lemon/utils
- server
- utils
3 files changed
+46
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1805 | 1805 | | |
1806 | 1806 | | |
1807 | 1807 | | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
1808 | 1823 | | |
1809 | 1824 | | |
1810 | 1825 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| 401 | + | |
401 | 402 | | |
402 | 403 | | |
403 | 404 | | |
| |||
410 | 411 | | |
411 | 412 | | |
412 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
413 | 425 | | |
414 | 426 | | |
415 | 427 | | |
| |||
419 | 431 | | |
420 | 432 | | |
421 | 433 | | |
| 434 | + | |
422 | 435 | | |
423 | 436 | | |
424 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
425 | 448 | | |
426 | 449 | | |
427 | 450 | | |
| |||
582 | 605 | | |
583 | 606 | | |
584 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
585 | 614 | | |
586 | 615 | | |
587 | 616 | | |
| |||
0 commit comments