Commit c954a8b
Phase 1.3: Graceful shutdown with WAL checkpoint flush
Add graceful_shutdown() method to InMemoryOctadStore that writes a final
WAL checkpoint and logs entity count before exit.
Wire into both serve() and serve_tls():
- tokio::signal handles Ctrl+C (SIGINT) and SIGTERM (Unix)
- axum::serve with_graceful_shutdown stops accepting new connections
- octad_store.graceful_shutdown() writes final WAL checkpoint
- TLS server uses axum_server::Handle for coordinated shutdown
This ensures clean WAL state on normal exit, reducing WAL replay
work on next startup and preventing false "uncommitted operation"
warnings.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9b78d6f commit c954a8b
2 files changed
Lines changed: 89 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1701 | 1701 | | |
1702 | 1702 | | |
1703 | 1703 | | |
1704 | | - | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
1705 | 1711 | | |
1706 | 1712 | | |
1707 | 1713 | | |
1708 | 1714 | | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
1709 | 1719 | | |
1710 | 1720 | | |
1711 | 1721 | | |
1712 | 1722 | | |
1713 | 1723 | | |
1714 | 1724 | | |
1715 | | - | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
1716 | 1736 | | |
1717 | 1737 | | |
1718 | 1738 | | |
1719 | 1739 | | |
1720 | | - | |
| 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 | + | |
1721 | 1766 | | |
1722 | 1767 | | |
1723 | 1768 | | |
| |||
1728 | 1773 | | |
1729 | 1774 | | |
1730 | 1775 | | |
| 1776 | + | |
| 1777 | + | |
1731 | 1778 | | |
1732 | 1779 | | |
1733 | 1780 | | |
| |||
1741 | 1788 | | |
1742 | 1789 | | |
1743 | 1790 | | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
1744 | 1800 | | |
| 1801 | + | |
1745 | 1802 | | |
1746 | 1803 | | |
1747 | 1804 | | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
1748 | 1811 | | |
1749 | 1812 | | |
1750 | 1813 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
349 | 372 | | |
350 | 373 | | |
351 | 374 | | |
| |||
0 commit comments