Commit 4c5a62d
authored
fix(org-drain): classify /update 409 lock contention as drain-superseded, not drain-failed (#1823)
fix(org-drain): classify /update 409 as drain-superseded, not drain-failed
The OrgActor drain races the source's own SourceActor scrape. When a stale
scrape source's 4h SourceActor poll lands within the scrape window of a drain
dispatch, the SourceActor grabs the per-source scrape lock (#1814/#1815) a beat
before the OrgActor dispatches its /update — so /update returns 409 "Source has
an active MA session". The lock guard is working correctly (it prevents a
double-scrape), and the source drains anyway via the lock holder's scrape.
But the OrgActor logged every non-ok /update as `drain-failed` (warn), so this
expected, benign contention polluted the drain-error signal. Treat a 409 (the
only status the /update source-dedup lock returns) as `drain-superseded` at info
level; every other non-ok status (spend cap 429, kill switch 503, mint failure)
stays `drain-failed`.1 parent c92b608 commit 4c5a62d
2 files changed
Lines changed: 62 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
129 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
130 | 140 | | |
131 | | - | |
| 141 | + | |
132 | 142 | | |
133 | 143 | | |
134 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
123 | 167 | | |
124 | 168 | | |
125 | 169 | | |
| |||
128 | 172 | | |
129 | 173 | | |
130 | 174 | | |
131 | | - | |
| 175 | + | |
132 | 176 | | |
133 | 177 | | |
| 178 | + | |
| 179 | + | |
134 | 180 | | |
135 | 181 | | |
136 | 182 | | |
| |||
0 commit comments