Commit b68731c
committed
fix(connectors): heartbeat every unbounded phase, not just the batch loop
The heartbeat was added where we happened to be looking. The pagination loop —
where a large source spends most of its wall clock, since the batch loop does not
start until every page is fetched — never beat at all, so a long listing on the
uncapped in-process path was still reclaimed as a hard failure. That is the exact
ratchet the heartbeat exists to prevent.
Auditing the remaining phases found something worse in the stuck-document retry:
on the in-process path it handed the entire backlog to a single await that fully
parses, embeds and indexes every document before returning, so no beat placement
could interrupt it. That dispatch is now chunked, with a beat per chunk.
All four call sites share one beatIfDue closure; the two pre-existing inline
blocks were collapsed onto it rather than left as copies.
An await longer than the TTL — one pathological listing page, or a very large
hard delete — is still not covered, and no inline beat can cover it. Closing that
needs a concurrent interval, which is a second mechanism and a separate decision.
Adds the first test that drives executeSync itself, reaching the pagination loop
through the real lock acquisition rather than testing helpers in isolation.1 parent 5cb942f commit b68731c
2 files changed
Lines changed: 135 additions & 16 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 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| |||
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
46 | 59 | | |
47 | 60 | | |
48 | 61 | | |
| |||
1530 | 1543 | | |
1531 | 1544 | | |
1532 | 1545 | | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
| |||
1196 | 1205 | | |
1197 | 1206 | | |
1198 | 1207 | | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
1199 | 1222 | | |
1200 | 1223 | | |
1201 | 1224 | | |
| |||
1303 | 1326 | | |
1304 | 1327 | | |
1305 | 1328 | | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
1306 | 1337 | | |
1307 | 1338 | | |
1308 | 1339 | | |
| |||
1480 | 1511 | | |
1481 | 1512 | | |
1482 | 1513 | | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
1488 | | - | |
| 1514 | + | |
1489 | 1515 | | |
1490 | 1516 | | |
1491 | 1517 | | |
| |||
1867 | 1893 | | |
1868 | 1894 | | |
1869 | 1895 | | |
1870 | | - | |
1871 | | - | |
1872 | | - | |
1873 | | - | |
1874 | | - | |
1875 | | - | |
| 1896 | + | |
1876 | 1897 | | |
1877 | 1898 | | |
1878 | 1899 | | |
| |||
1976 | 1997 | | |
1977 | 1998 | | |
1978 | 1999 | | |
1979 | | - | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
1980 | 2003 | | |
1981 | | - | |
| 2004 | + | |
1982 | 2005 | | |
1983 | 2006 | | |
1984 | 2007 | | |
| |||
0 commit comments