Commit 566400a
committed
Fix hard download error on 404 etc
I've observed errors when some mirrors are not completely synced. The
library tries to download a file, but gets a 404 error. This means we
need to retry with another mirror, not crash out. This was crashing
because setting `err` in `clean_transcode()` was firing the assert at
the start of `truncate_transfer_file()`. Note this failure mode was most
common with 404's, but any transfer error could likely have turned
fatal, for invalid reasons.
We use `cleanup_transcode()` in two contexts.
1. Within `check_transfer_statuses()`. The first call here happens
during a normal download after `check_finished_transfer_status()`.
The cleanup checks for errors, and any here will be flagged as a
`transfer_err` (not a general, err).
2. In 3 other places where an error has already occurred. We need to
wait for the program to exit (and it should stop due to a SIGPIPE
or short read from stdin), but we don't need to set an error because
something already is handling one. It doesn't matter that the
transcoder crashed because we're not going to use the output anyway,
and we are likely to retry.1 parent 638dd0a commit 566400a
1 file changed
Lines changed: 14 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1530 | 1530 | | |
1531 | 1531 | | |
1532 | 1532 | | |
1533 | | - | |
| 1533 | + | |
1534 | 1534 | | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
1535 | 1539 | | |
1536 | 1540 | | |
1537 | 1541 | | |
| |||
1541 | 1545 | | |
1542 | 1546 | | |
1543 | 1547 | | |
1544 | | - | |
| 1548 | + | |
1545 | 1549 | | |
1546 | 1550 | | |
1547 | 1551 | | |
1548 | 1552 | | |
1549 | | - | |
| 1553 | + | |
1550 | 1554 | | |
1551 | 1555 | | |
1552 | 1556 | | |
1553 | | - | |
| 1557 | + | |
1554 | 1558 | | |
1555 | 1559 | | |
1556 | 1560 | | |
1557 | 1561 | | |
1558 | | - | |
| 1562 | + | |
1559 | 1563 | | |
1560 | 1564 | | |
1561 | 1565 | | |
| |||
1822 | 1826 | | |
1823 | 1827 | | |
1824 | 1828 | | |
1825 | | - | |
| 1829 | + | |
1826 | 1830 | | |
1827 | 1831 | | |
1828 | 1832 | | |
| |||
2390 | 2394 | | |
2391 | 2395 | | |
2392 | 2396 | | |
| 2397 | + | |
| 2398 | + | |
2393 | 2399 | | |
2394 | 2400 | | |
2395 | 2401 | | |
2396 | | - | |
2397 | | - | |
2398 | 2402 | | |
2399 | 2403 | | |
2400 | 2404 | | |
| |||
2489 | 2493 | | |
2490 | 2494 | | |
2491 | 2495 | | |
2492 | | - | |
| 2496 | + | |
2493 | 2497 | | |
2494 | 2498 | | |
2495 | 2499 | | |
| |||
2893 | 2897 | | |
2894 | 2898 | | |
2895 | 2899 | | |
2896 | | - | |
| 2900 | + | |
2897 | 2901 | | |
2898 | 2902 | | |
2899 | 2903 | | |
| |||
0 commit comments