Commit bdb3a55
authored
feat(db): configurable Postgres statement_timeout on pool connections (#1200)
* feat(db): apply configurable Postgres statement_timeout on pool connections
Adds HINDSIGHT_API_DB_STATEMENT_TIMEOUT (default 600s, set 0 to disable).
Applied via the asyncpg pool init hook, so it only affects runtime
queries — Alembic migrations run on a separate psycopg2 engine and are
untouched.
Also fixes the ANN chunk path in the retain orchestrator to restore the
pool's configured statement_timeout rather than RESET, which would fall
back to the server default and silently drop the safety net on that
pooled connection.
* refactor(ann): drop fixed per-query timeout on compute_semantic_links_ann
Now that the asyncpg pool applies a Postgres statement_timeout to every
connection (HINDSIGHT_API_DB_STATEMENT_TIMEOUT, default 600s), the ANN
path can be treated like any other query — no need for the 300s asyncpg
per-query timeout or the orchestrator's SET/restore dance around the
pool's default.
* chore: regenerate hindsight-docs skill to pick up configuration doc change
Re-runs scripts/generate-docs-skill.sh so the skill reference mirror
matches the HINDSIGHT_API_DB_STATEMENT_TIMEOUT row added in
hindsight-docs/docs/developer/configuration.md.
Also picks up unrelated drift (openapi.json version bump, changelog
index) that had accumulated on main.1 parent f1700af commit bdb3a55
6 files changed
Lines changed: 17 additions & 5 deletions
File tree
- hindsight-api-slim/hindsight_api
- engine
- retain
- hindsight-docs/docs/developer
- skills/hindsight-docs/references/developer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| 378 | + | |
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
| |||
607 | 608 | | |
608 | 609 | | |
609 | 610 | | |
| 611 | + | |
610 | 612 | | |
611 | 613 | | |
612 | 614 | | |
| |||
1064 | 1066 | | |
1065 | 1067 | | |
1066 | 1068 | | |
| 1069 | + | |
1067 | 1070 | | |
1068 | 1071 | | |
1069 | 1072 | | |
| |||
1671 | 1674 | | |
1672 | 1675 | | |
1673 | 1676 | | |
| 1677 | + | |
1674 | 1678 | | |
1675 | 1679 | | |
1676 | 1680 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| 485 | + | |
485 | 486 | | |
486 | 487 | | |
487 | 488 | | |
| |||
1848 | 1849 | | |
1849 | 1850 | | |
1850 | 1851 | | |
| 1852 | + | |
| 1853 | + | |
1851 | 1854 | | |
1852 | 1855 | | |
1853 | 1856 | | |
| |||
1857 | 1860 | | |
1858 | 1861 | | |
1859 | 1862 | | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
1860 | 1869 | | |
1861 | 1870 | | |
1862 | 1871 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
815 | | - | |
816 | 815 | | |
817 | 816 | | |
818 | 817 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
756 | | - | |
757 | 756 | | |
758 | 757 | | |
759 | 758 | | |
| |||
766 | 765 | | |
767 | 766 | | |
768 | 767 | | |
769 | | - | |
770 | 768 | | |
771 | 769 | | |
772 | 770 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
0 commit comments