pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Avoid lockup of a parallel worker when reporting a long error me 7+ messages / 1 participants [nested] [flat]
* pgsql: Avoid lockup of a parallel worker when reporting a long error me @ 2020-09-03 20:52 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-09-03 20:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid lockup of a parallel worker when reporting a long error message. Because sigsetjmp() will restore the initial state with signals blocked, the code path in bgworker.c for reporting an error and exiting would execute that way. Usually this is fairly harmless; but if a parallel worker had an error message exceeding the shared-memory communication buffer size (16K) it would lock up, because it would wait for a resume-sending signal from its parallel leader which it would never detect. To fix, just unblock signals at the appropriate point. This can be shown to fail back to 9.6. The lack of parallel query infrastructure makes it difficult to provide a simple test case for 9.5; but I'm pretty sure the issue exists in some form there as well, so apply the code change there too. Vignesh C, reviewed by Bharath Rupireddy, Robert Haas, and myself Discussion: https://postgr.es/m/CALDaNm1d1hHPZUg3xU4XjtWBOLCrA+-2cJcLpw-cePZ=GgDVfA@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/be4b0c0077e6a1f7be0965f8d93696e0e0eadb52 Modified Files -------------- src/backend/postmaster/bgworker.c | 11 +++++++++-- src/test/regress/expected/select_parallel.out | 5 +++-- src/test/regress/sql/select_parallel.sql | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Avoid lockup of a parallel worker when reporting a long error me @ 2020-09-03 20:52 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-09-03 20:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid lockup of a parallel worker when reporting a long error message. Because sigsetjmp() will restore the initial state with signals blocked, the code path in bgworker.c for reporting an error and exiting would execute that way. Usually this is fairly harmless; but if a parallel worker had an error message exceeding the shared-memory communication buffer size (16K) it would lock up, because it would wait for a resume-sending signal from its parallel leader which it would never detect. To fix, just unblock signals at the appropriate point. This can be shown to fail back to 9.6. The lack of parallel query infrastructure makes it difficult to provide a simple test case for 9.5; but I'm pretty sure the issue exists in some form there as well, so apply the code change there too. Vignesh C, reviewed by Bharath Rupireddy, Robert Haas, and myself Discussion: https://postgr.es/m/CALDaNm1d1hHPZUg3xU4XjtWBOLCrA+-2cJcLpw-cePZ=GgDVfA@mail.gmail.com Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/17424e79d9794b00bdb6653185fc27ba423d8d81 Modified Files -------------- src/backend/postmaster/bgworker.c | 11 +++++++++-- src/test/regress/expected/select_parallel.out | 5 +++-- src/test/regress/sql/select_parallel.sql | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Avoid lockup of a parallel worker when reporting a long error me @ 2020-09-03 20:52 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-09-03 20:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid lockup of a parallel worker when reporting a long error message. Because sigsetjmp() will restore the initial state with signals blocked, the code path in bgworker.c for reporting an error and exiting would execute that way. Usually this is fairly harmless; but if a parallel worker had an error message exceeding the shared-memory communication buffer size (16K) it would lock up, because it would wait for a resume-sending signal from its parallel leader which it would never detect. To fix, just unblock signals at the appropriate point. This can be shown to fail back to 9.6. The lack of parallel query infrastructure makes it difficult to provide a simple test case for 9.5; but I'm pretty sure the issue exists in some form there as well, so apply the code change there too. Vignesh C, reviewed by Bharath Rupireddy, Robert Haas, and myself Discussion: https://postgr.es/m/CALDaNm1d1hHPZUg3xU4XjtWBOLCrA+-2cJcLpw-cePZ=GgDVfA@mail.gmail.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/82dd373f2c56f7b32a3304260195fdaf6ed7cd9c Modified Files -------------- src/backend/postmaster/bgworker.c | 11 +++++++++-- src/test/regress/expected/select_parallel.out | 5 +++-- src/test/regress/sql/select_parallel.sql | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Avoid lockup of a parallel worker when reporting a long error me @ 2020-09-03 20:52 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-09-03 20:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid lockup of a parallel worker when reporting a long error message. Because sigsetjmp() will restore the initial state with signals blocked, the code path in bgworker.c for reporting an error and exiting would execute that way. Usually this is fairly harmless; but if a parallel worker had an error message exceeding the shared-memory communication buffer size (16K) it would lock up, because it would wait for a resume-sending signal from its parallel leader which it would never detect. To fix, just unblock signals at the appropriate point. This can be shown to fail back to 9.6. The lack of parallel query infrastructure makes it difficult to provide a simple test case for 9.5; but I'm pretty sure the issue exists in some form there as well, so apply the code change there too. Vignesh C, reviewed by Bharath Rupireddy, Robert Haas, and myself Discussion: https://postgr.es/m/CALDaNm1d1hHPZUg3xU4XjtWBOLCrA+-2cJcLpw-cePZ=GgDVfA@mail.gmail.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/526df0a236df7d6d12ea91e9538af7efc5896d25 Modified Files -------------- src/backend/postmaster/bgworker.c | 11 +++++++++-- src/test/regress/expected/select_parallel.out | 5 +++-- src/test/regress/sql/select_parallel.sql | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Avoid lockup of a parallel worker when reporting a long error me @ 2020-09-03 20:52 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-09-03 20:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid lockup of a parallel worker when reporting a long error message. Because sigsetjmp() will restore the initial state with signals blocked, the code path in bgworker.c for reporting an error and exiting would execute that way. Usually this is fairly harmless; but if a parallel worker had an error message exceeding the shared-memory communication buffer size (16K) it would lock up, because it would wait for a resume-sending signal from its parallel leader which it would never detect. To fix, just unblock signals at the appropriate point. This can be shown to fail back to 9.6. The lack of parallel query infrastructure makes it difficult to provide a simple test case for 9.5; but I'm pretty sure the issue exists in some form there as well, so apply the code change there too. Vignesh C, reviewed by Bharath Rupireddy, Robert Haas, and myself Discussion: https://postgr.es/m/CALDaNm1d1hHPZUg3xU4XjtWBOLCrA+-2cJcLpw-cePZ=GgDVfA@mail.gmail.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2a938c7935cf838b99b2017c5f86f9435ad9ad7e Modified Files -------------- src/backend/postmaster/bgworker.c | 11 +++++++++-- src/test/regress/expected/select_parallel.out | 5 +++-- src/test/regress/sql/select_parallel.sql | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Avoid lockup of a parallel worker when reporting a long error me @ 2020-09-03 20:52 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-09-03 20:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid lockup of a parallel worker when reporting a long error message. Because sigsetjmp() will restore the initial state with signals blocked, the code path in bgworker.c for reporting an error and exiting would execute that way. Usually this is fairly harmless; but if a parallel worker had an error message exceeding the shared-memory communication buffer size (16K) it would lock up, because it would wait for a resume-sending signal from its parallel leader which it would never detect. To fix, just unblock signals at the appropriate point. This can be shown to fail back to 9.6. The lack of parallel query infrastructure makes it difficult to provide a simple test case for 9.5; but I'm pretty sure the issue exists in some form there as well, so apply the code change there too. Vignesh C, reviewed by Bharath Rupireddy, Robert Haas, and myself Discussion: https://postgr.es/m/CALDaNm1d1hHPZUg3xU4XjtWBOLCrA+-2cJcLpw-cePZ=GgDVfA@mail.gmail.com Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2500e51e7bdc6c4f01312db276d3460644684112 Modified Files -------------- src/backend/postmaster/bgworker.c | 11 +++++++++-- src/test/regress/expected/select_parallel.out | 7 ++++--- src/test/regress/sql/select_parallel.sql | 3 ++- 3 files changed, 15 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Avoid lockup of a parallel worker when reporting a long error me @ 2020-09-03 20:52 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-09-03 20:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid lockup of a parallel worker when reporting a long error message. Because sigsetjmp() will restore the initial state with signals blocked, the code path in bgworker.c for reporting an error and exiting would execute that way. Usually this is fairly harmless; but if a parallel worker had an error message exceeding the shared-memory communication buffer size (16K) it would lock up, because it would wait for a resume-sending signal from its parallel leader which it would never detect. To fix, just unblock signals at the appropriate point. This can be shown to fail back to 9.6. The lack of parallel query infrastructure makes it difficult to provide a simple test case for 9.5; but I'm pretty sure the issue exists in some form there as well, so apply the code change there too. Vignesh C, reviewed by Bharath Rupireddy, Robert Haas, and myself Discussion: https://postgr.es/m/CALDaNm1d1hHPZUg3xU4XjtWBOLCrA+-2cJcLpw-cePZ=GgDVfA@mail.gmail.com Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3738651f5b8278a0a5748133667339434bd24139 Modified Files -------------- src/backend/postmaster/bgworker.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2020-09-03 20:52 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-09-03 20:52 pgsql: Avoid lockup of a parallel worker when reporting a long error me Tom Lane <tgl@sss.pgh.pa.us> 2020-09-03 20:52 pgsql: Avoid lockup of a parallel worker when reporting a long error me Tom Lane <tgl@sss.pgh.pa.us> 2020-09-03 20:52 pgsql: Avoid lockup of a parallel worker when reporting a long error me Tom Lane <tgl@sss.pgh.pa.us> 2020-09-03 20:52 pgsql: Avoid lockup of a parallel worker when reporting a long error me Tom Lane <tgl@sss.pgh.pa.us> 2020-09-03 20:52 pgsql: Avoid lockup of a parallel worker when reporting a long error me Tom Lane <tgl@sss.pgh.pa.us> 2020-09-03 20:52 pgsql: Avoid lockup of a parallel worker when reporting a long error me Tom Lane <tgl@sss.pgh.pa.us> 2020-09-03 20:52 pgsql: Avoid lockup of a parallel worker when reporting a long error me Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox