Commit e5f9dd1
committed
fix(webapp): use prisma writer for post-race re-read of session row in sessionRunManager
The lost-race re-read in ensureRunForSession and swapSessionRun reads
the Session row that the winner just wrote on the writer. Reading from
$replica could return pre-race state and either (1) cause
ensureRunForSession to recurse with a stale currentRunVersion, fail the
next claim, and waste runs until max-attempts; or (2) cause
swapSessionRun to return swapped: false with the calling run's own id,
misleading the caller into thinking it is still authoritative.1 parent c0e87bf commit e5f9dd1
1 file changed
Lines changed: 11 additions & 2 deletions
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
| |||
327 | 331 | | |
328 | 332 | | |
329 | 333 | | |
330 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
331 | 340 | | |
332 | 341 | | |
333 | 342 | | |
| |||
0 commit comments