Commit ae808a4
committed
Skip Release for sessions that were not mutated
The file provider (and others that persist via Encode in Release) writes the
session unconditionally at the end of every request. Two concurrent reads of
the same session ID then race: each request encodes its stale snapshot and
writes it back, so an in-flight mutation from a third request can be clobbered.
Track Set/Delete/Flush calls on a wrapper around the per-request RawStore and
skip Release when nothing was written. Reads no longer touch the backing
store, eliminating the race for read-only traffic.1 parent ab7cb8b commit ae808a4
1 file changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
74 | 99 | | |
75 | 100 | | |
76 | 101 | | |
| |||
187 | 212 | | |
188 | 213 | | |
189 | 214 | | |
| 215 | + | |
190 | 216 | | |
191 | | - | |
| 217 | + | |
192 | 218 | | |
193 | 219 | | |
194 | 220 | | |
| |||
200 | 226 | | |
201 | 227 | | |
202 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
203 | 232 | | |
204 | 233 | | |
205 | 234 | | |
| |||
0 commit comments