Commit 5d10e31
chore: corruption-hardening ops (shutdown budget, journald logs, DuckDB spill)
Follow-up to the durable derivation queue. Three small prod-hardening changes against the 2026-06-06 incident's failure modes:
1. Shutdown budget made coherent: split into SHUTDOWN_WORKER_WAIT (30s, lets the worker finish its current derive) + SHUTDOWN_WRITE_WAIT (10s, in-flight raw upsert), summing to 40s < the new 45s stop_grace_period. Previously both phases used 25s each (worst case 50s > 30s grace -> Docker could SIGKILL mid-write).
2. API logging switched json-file -> journald so logs land in the host journal and SURVIVE container recreation. Root cause was unprovable on 2026-06-06 because the dead container's json-file logs vanished when it was recreated. docker logs + journalctl -t ohlc-datalake-api both still work.
3. DuckDB temp_directory set on the data volume so operations spill to disk past the 2GB memory_limit instead of growing until the cgroup OOM-kills the container mid-write (OOM-mid-checkpoint is the leading incident suspect on the 7.6GiB host).
Full suite 247 passed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent c7196b1 commit 5d10e31
3 files changed
Lines changed: 29 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | | - | |
| 71 | + | |
66 | 72 | | |
67 | | - | |
68 | | - | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
99 | | - | |
100 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| 48 | + | |
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
| |||
0 commit comments