forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc9ae5cb
committed
Install an error check into cancel_before_shmem_exit().
Historically, cancel_before_shmem_exit() just silently did nothingif the specified callback wasn't the top-of-stack. The folly ofignoring this case was exposed by the bugs fixed in3036401 andbab1500, so let's make it throw elog(ERROR) instead.There is a decent argument to be made that PG_ENSURE_ERROR_CLEANUPshould use some separate infrastructure, so it wouldn't break ifsomething inside the guarded code decides to register a newbefore_shmem_exit callback. However, a survey of the survivinguses of before_shmem_exit() and PG_ENSURE_ERROR_CLEANUP doesn'tshow any plausible conflicts of that sort today, so for now we'llforgo the extra complexity. (It will almost certainly becomenecessary if anyone ever wants to wrap PG_ENSURE_ERROR_CLEANUParound arbitrary user-defined actions, though.)No backpatch, since this is developer support not a production issue.Bharath Rupireddy, per advice from Andres Freund, Robert Haas, and myselfDiscussion:https://postgr.es/m/CALj2ACWk7j4F2v2fxxYfrroOF=AdFNPr1WsV+AGtHAFQOqm_pw@mail.gmail.com1 parent5871f09 commitc9ae5cb
1 file changed
+6
-3
lines changedLines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
381 | 381 |
| |
382 | 382 |
| |
383 | 383 |
| |
384 |
| - | |
385 |
| - | |
386 |
| - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
387 | 387 |
| |
388 | 388 |
| |
389 | 389 |
| |
| |||
394 | 394 |
| |
395 | 395 |
| |
396 | 396 |
| |
| 397 | + | |
| 398 | + | |
| 399 | + | |
397 | 400 |
| |
398 | 401 |
| |
399 | 402 |
| |
|
0 commit comments
Comments
(0)