Repository navigation
Commit fcd141c
Retry stalled SwiftPM artifact downloads (#59214)
Summary:
SwiftPM artifact setup currently fails an entire CI lane when a Maven response stalls mid-body. This change:
- aborts a download after 60 seconds without body progress;
- retries transient transport errors and HTTP 408/429/5xx responses up to three total attempts with short backoff;
- keeps deterministic HTTP client errors fail-fast; and
- removes partial `.download` files before retrying, so a retry cannot reuse truncated content.
## Changelog:
[INTERNAL] [FIXED] - Retry stalled SwiftPM artifact downloads
## Diagnosis
`main` commit `f1f516e8cb2f6c085bcc08838066b5b49c08da3b` failed `test_ios_spm_rntester / test (Debug)` in job https://github.com/react/react-native/actions/runs/39353507614/job/118412160607. The Hermes release artifact stopped at 8.0 MB of 24.2 MB and 0 KB/s for about ten minutes before Node fetch reported `terminated`.
This is a transport flake rather than a deterministic source regression:
- the Release sibling on the same SHA completed successfully;
- both SwiftPM RNTester lanes passed on each of the 19 preceding `main` workflow runs (38/38 checks);
- the tip commit only changes Fantom SelectableParagraph rendering; and
- the exact failed artifact downloaded successfully on a subsequent probe (25,372,145 bytes in 0.29 seconds).
Because the failure is nondeterministic and independent of the commit contents, a code bisect cannot identify a meaningful introducing commit. Searches of open PRs and prior CI-monitor runs found no existing fix for this stalled-download signature. PR #59068 mentions the downloader only in its diagnosis and changes different prebuild files.
Pull Request resolved: #59214
Test Plan:
- `node --check packages/react-native/scripts/spm/download-spm-artifacts.js`
- `npx -y prettier@3.9.4 --write packages/react-native/scripts/spm/download-spm-artifacts.js packages/react-native/scripts/spm/__tests__/download-spm-artifacts-test.js` (no changes)
- `jest --runInBand packages/react-native/scripts/spm/__tests__/download-spm-artifacts-test.js` — 76/76 tests passed, including transient stream retry, idle-body retry, partial-file cleanup, and fail-fast HTTP 404 coverage
- Live curl probe of the exact Hermes artifact — HTTP 200, 25,372,145 bytes
## Risk and limitations
A genuinely slow transfer that makes no progress for 60 seconds is restarted, which may add up to roughly two minutes plus backoff before the final failure. The retry is bounded and final errors are still surfaced; deterministic 4xx responses are not retried. Full RNTester/Xcode CI was not reproduced locally because the failure is in remote transport rather than compilation.
Reviewed By: cipolleschi
Differential Revision: D126318143
Pulled By: cortinico
fbshipit-source-id: c413b2278c4ca735e69a1d275f33e74fcea679ca1 parent 6200203 commit fcd141c
2 files changed
Lines changed: 185 additions & 8 deletions
File tree
- packages/react-native/scripts/spm
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
545 | 546 | | |
546 | 547 | | |
547 | 548 | | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
548 | 668 | | |
549 | 669 | | |
550 | 670 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
643 | | - | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
644 | 659 | | |
645 | 660 | | |
646 | 661 | | |
647 | 662 | | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | 663 | | |
654 | 664 | | |
655 | 665 | | |
| |||
662 | 672 | | |
663 | 673 | | |
664 | 674 | | |
| 675 | + | |
665 | 676 | | |
666 | 677 | | |
667 | 678 | | |
| |||
719 | 730 | | |
720 | 731 | | |
721 | 732 | | |
722 | | - | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
723 | 743 | | |
724 | 744 | | |
725 | 745 | | |
726 | 746 | | |
| 747 | + | |
727 | 748 | | |
728 | 749 | | |
729 | 750 | | |
| 751 | + | |
730 | 752 | | |
731 | 753 | | |
732 | 754 | | |
| |||
737 | 759 | | |
738 | 760 | | |
739 | 761 | | |
| 762 | + | |
740 | 763 | | |
741 | 764 | | |
742 | 765 | | |
743 | 766 | | |
| 767 | + | |
| 768 | + | |
744 | 769 | | |
745 | 770 | | |
746 | 771 | | |
| |||
753 | 778 | | |
754 | 779 | | |
755 | 780 | | |
756 | | - | |
| 781 | + | |
757 | 782 | | |
758 | 783 | | |
759 | 784 | | |
| |||
763 | 788 | | |
764 | 789 | | |
765 | 790 | | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
766 | 822 | | |
767 | 823 | | |
768 | 824 | | |
| |||
1544 | 1600 | | |
1545 | 1601 | | |
1546 | 1602 | | |
| 1603 | + | |
1547 | 1604 | | |
1548 | 1605 | | |
1549 | 1606 | | |
| |||
0 commit comments