]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Hold interrupts while running dsm_detach() callbacks.
authorThomas Munro <tmunro@postgresql.org>
Mon, 15 Feb 2021 00:32:58 +0000 (13:32 +1300)
committerThomas Munro <tmunro@postgresql.org>
Mon, 15 Feb 2021 01:21:01 +0000 (14:21 +1300)
commitacafdd9ed5f05742730ee666abf49b89e8a125ad
treec431c2596d7619ba4315abb47dc81bc97b6990a6
parent22001684623bd95b4e1d5c21854f222a37b13267
Hold interrupts while running dsm_detach() callbacks.

While cleaning up after a parallel query or parallel index creation that
created temporary files, we could be interrupted by a statement timeout.
The error handling path would then fail to clean up the files when it
ran dsm_detach() again, because the callback was already popped off the
list.  Prevent this hazard by holding interrupts while the cleanup code
runs.

Thanks to Heikki Linnakangas for this suggestion, and also to Kyotaro
Horiguchi, Masahiko Sawada, Justin Pryzby and Tom Lane for discussion of
this and earlier ideas on how to fix the problem.

Back-patch to all supported releases.

Reported-by: Justin Pryzby <pryzby@telsasoft.com>
Discussion: https://postgr.es/m/20191212180506.GR2082@telsasoft.com
src/backend/storage/ipc/dsm.c