Commit f1a4338
committed
fix(kiloclaw): make getActiveInstance deterministic with ORDER BY created_at
Add ORDER BY created_at ASC to getActiveInstance so LIMIT 1 always
returns the oldest active row. Documents the known race window in
ensureActiveInstance where concurrent callers can both insert — the
consequence is a benign orphan row since all subsequent reads converge
on the same (oldest) row.1 parent ad0569b commit f1a4338
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
| |||
178 | 183 | | |
179 | 184 | | |
180 | 185 | | |
| 186 | + | |
181 | 187 | | |
182 | 188 | | |
183 | 189 | | |
| |||
0 commit comments