Commit 6eaeffe
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 9fada81 commit 6eaeffe
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 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| |||
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
47 | 60 | | |
48 | 61 | | |
49 | 62 | | |
| |||
1716 | 1729 | | |
1717 | 1730 | | |
1718 | 1731 | | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 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 | | |
| |||
1309 | 1318 | | |
1310 | 1319 | | |
1311 | 1320 | | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
1312 | 1335 | | |
1313 | 1336 | | |
1314 | 1337 | | |
| |||
1416 | 1439 | | |
1417 | 1440 | | |
1418 | 1441 | | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
1419 | 1450 | | |
1420 | 1451 | | |
1421 | 1452 | | |
| |||
1593 | 1624 | | |
1594 | 1625 | | |
1595 | 1626 | | |
1596 | | - | |
1597 | | - | |
1598 | | - | |
1599 | | - | |
1600 | | - | |
1601 | | - | |
| 1627 | + | |
1602 | 1628 | | |
1603 | 1629 | | |
1604 | 1630 | | |
| |||
1980 | 2006 | | |
1981 | 2007 | | |
1982 | 2008 | | |
1983 | | - | |
1984 | | - | |
1985 | | - | |
1986 | | - | |
1987 | | - | |
1988 | | - | |
| 2009 | + | |
1989 | 2010 | | |
1990 | 2011 | | |
1991 | 2012 | | |
| |||
2098 | 2119 | | |
2099 | 2120 | | |
2100 | 2121 | | |
2101 | | - | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
2102 | 2125 | | |
2103 | | - | |
| 2126 | + | |
2104 | 2127 | | |
2105 | 2128 | | |
2106 | 2129 | | |
| |||
0 commit comments