Commit 444e0f2
authored
fix: Prevent infinite loop in legacy edx course export op (#2212)
The export_edx_courses op had two bugs causing the courses/ folder to go
missing in S3 data packages (mitx-etl-mitxonline-production, since ~2026-01-21):
1. Infinite loop in status-polling
HTTPStatusError (e.g. HTTP 404 after django-user-tasks record cleanup) was
swallowed by a bare `continue`, so failed courses were never added to
failed_exports and the while-loop never terminated. Fixed by only treating
404 as a soft failure (mark as failed_exports); all other status codes now
re-raise. Added a 60-minute hard timeout that raises TimeoutError instead of
silently breaking.
2. Abort on partial-failure from the export trigger API
The ol_openedx_course_export plugin returns HTTP 400 when some (but not all)
courses fail to queue. The unconditional raise_for_status() aborted the entire
op before successfully-queued courses could be processed. Fixed by allowing
400 through only when the response body contains the expected partial-failure
schema (upload_task_ids key); other 400s still raise.
Fixes: mitodl/hq#11104
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 6a3020a commit 444e0f2
2 files changed
Lines changed: 50 additions & 4 deletions
File tree
- dg_projects/legacy_openedx/legacy_openedx/ops
- packages/ol-orchestrate-lib/src/ol_orchestrate/resources
Lines changed: 31 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
568 | 570 | | |
569 | 571 | | |
570 | 572 | | |
571 | | - | |
| 573 | + | |
572 | 574 | | |
573 | 575 | | |
574 | 576 | | |
| |||
577 | 579 | | |
578 | 580 | | |
579 | 581 | | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
580 | 588 | | |
581 | 589 | | |
582 | 590 | | |
583 | 591 | | |
584 | 592 | | |
585 | 593 | | |
| 594 | + | |
586 | 595 | | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
587 | 603 | | |
588 | 604 | | |
| 605 | + | |
| 606 | + | |
589 | 607 | | |
590 | 608 | | |
591 | 609 | | |
592 | 610 | | |
593 | 611 | | |
594 | | - | |
595 | | - | |
596 | | - | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
597 | 624 | | |
598 | 625 | | |
599 | 626 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
67 | 76 | | |
68 | 77 | | |
69 | 78 | | |
| |||
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
75 | 94 | | |
76 | 95 | | |
77 | 96 | | |
| |||
0 commit comments