Commit b5afbcd
committed
Never lose a run to a failed rsync
Testing pull request 16696 finished its 96 libraries and then died
publishing them, taking three hours of results with it. Two separate
problems.
**The rsync failure.** `publishLibrary` created the remote directories
from four joblib threads, each running
`rsync -aR emptydir/./<lib>/files <branch>`. rsync's receiver creates
the destination directory with a plain mkdir, and the destination here
was `branches/pr/16696`, shared by all four: three won, `Modelica_3.2.3`
lost and got
rsync: [Receiver] mkdir ".../pr/16696" failed: File exists (17)
rsync error: error in file IO (code 11)
A branch tested before has that directory already, so only the
per-library components are created and they never collide -- this is a
pull request's first run every time, and `branches/pr/` existing from an
earlier one does not help, `16696` itself is the contended level. The
`mkdir -p` the Jenkinsfile does looks like it covers this but runs on
the build node, not on the web server.
Create the directories once, serially, before the threads start, and
with `--mkpath` so the mkdir tolerates a directory another rsync made
and so the two levels of a `pr/<number>` are created at all. That also
drops one ssh connection per library.
**The lost results.** The transaction was held open until after
publishing, so the exception rolled back everything the run had
measured. Commit before generating and publishing the reports instead:
rows whose pages are missing are a report to publish again, rather than
a run to do again. `clean-empty-omcversion-dates.py` still drops a date
that got no rows.
A library that cannot be published no longer aborts the other 95
either; the failures are collected and the run fails once at the end.
Checked with `configs/sanityCheck.json` and a stub rsync: one
`-aR --mkpath <lib1>/files <lib2>/files <dest>` followed by one content
rsync per library, and with a failure injected into one library the
other still publishes, all rows reach the database and the exit status
is 1.
Assisted-by: Claude Opus 5 (1M context)1 parent 1418d01 commit b5afbcd
1 file changed
Lines changed: 40 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
1259 | 1259 | | |
1260 | 1260 | | |
1261 | 1261 | | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
1262 | 1266 | | |
1263 | 1267 | | |
1264 | 1268 | | |
| |||
1425 | 1429 | | |
1426 | 1430 | | |
1427 | 1431 | | |
| 1432 | + | |
1428 | 1433 | | |
1429 | 1434 | | |
1430 | 1435 | | |
| |||
1435 | 1440 | | |
1436 | 1441 | | |
1437 | 1442 | | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
1438 | 1457 | | |
1439 | 1458 | | |
1440 | 1459 | | |
| |||
1542 | 1561 | | |
1543 | 1562 | | |
1544 | 1563 | | |
1545 | | - | |
1546 | | - | |
1547 | | - | |
1548 | | - | |
1549 | | - | |
1550 | | - | |
1551 | 1564 | | |
1552 | 1565 | | |
1553 | 1566 | | |
1554 | | - | |
| 1567 | + | |
1555 | 1568 | | |
1556 | 1569 | | |
1557 | 1570 | | |
| |||
1588 | 1601 | | |
1589 | 1602 | | |
1590 | 1603 | | |
1591 | | - | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
1592 | 1619 | | |
1593 | 1620 | | |
1594 | 1621 | | |
| |||
1608 | 1635 | | |
1609 | 1636 | | |
1610 | 1637 | | |
1611 | | - | |
1612 | | - | |
1613 | | - | |
1614 | 1638 | | |
1615 | 1639 | | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
1616 | 1644 | | |
0 commit comments