forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit597f669
committed
injection_points: Fix incorrect spinlock acquisition
Injection points created under injection_points_set_local() are cleanedup by a shmem_exit() callback. The spinlock used by the module wouldbe hold while calling InjectionPointDetach(), which is incorrect asspinlocks should avoid external calls while hold.This commit changes the shmem_exit() callback to detach the points inthree steps with the spinlock acquired twice, knowing that theinjection points should be around with the conditions related to them:- Scans for the points to detach in a first loop, while holding thespinlock.- Detach them.- Remove the registered conditions.It is still possible for other processes to detach local pointsconcurrently of the callback. I have wanted to restrict the detach, butNoah has mentioned that he has in mind some cases that may require thiscapability. No tests in the tree based on injection points need thatcurrently.Thinko inf587338.Reported-by: Noah MischReviewed-by: Noah MischDiscussion:https://postgr.es/m/20240501231214.40@rfd.leadboat.com1 parent713cfaf commit597f669
1 file changed
+29
-2
lines changedLines changed: 29 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
159 | 159 |
| |
160 | 160 |
| |
161 | 161 |
| |
| 162 | + | |
| 163 | + | |
| 164 | + | |
162 | 165 |
| |
163 | 166 |
| |
164 | 167 |
| |
165 | 168 |
| |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
166 | 195 |
| |
167 | 196 |
| |
168 | 197 |
| |
| |||
174 | 203 |
| |
175 | 204 |
| |
176 | 205 |
| |
177 |
| - | |
178 |
| - | |
179 | 206 |
| |
180 | 207 |
| |
181 | 208 |
| |
|
0 commit comments
Comments
(0)