Commit a09ea80
Avoid possible infinite loops on APCu eviction (#136)
If we are unlucky with an APCu eviction at the wrong moment, and no
other thread writing to the same metric, we can get stuck in an
infinite loop where apcu_fetch will always return false.
Fix by applying the same strategy as if apcu_fetch was false in the
first place (before doing compare-and-swap)
Signed-off-by: Tobias Bengtsson <me@tobiasbengtsson.se>
Co-authored-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>1 parent 3f915df commit a09ea80
1 file changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| |||
160 | 167 | | |
161 | 168 | | |
162 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
163 | 175 | | |
164 | 176 | | |
165 | 177 | | |
| |||
183 | 195 | | |
184 | 196 | | |
185 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
186 | 201 | | |
187 | 202 | | |
188 | 203 | | |
| |||
0 commit comments