pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Client-side fixes for delayed NOTIFY receipt. 5+ messages / 1 participants [nested] [flat]
* pgsql: Client-side fixes for delayed NOTIFY receipt. @ 2018-10-20 02:23 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2018-10-20 02:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Client-side fixes for delayed NOTIFY receipt. PQnotifies() is defined to just process already-read data, not try to read any more from the socket. (This is a debatable decision, perhaps, but I'm hesitant to change longstanding library behavior.) The documentation has long recommended calling PQconsumeInput() before PQnotifies() to ensure that any already-arrived message would get absorbed and processed. However, psql did not get that memo, which explains why it's not very reliable about reporting notifications promptly. Also, most (not quite all) callers called PQconsumeInput() just once before a PQnotifies() loop. Taking this recommendation seriously implies that we should do PQconsumeInput() before each call. This is more important now that we have "payload" strings in notification messages than it was before; that increases the probability of having more than one packet's worth of notify messages. Hence, adjust code as well as documentation examples to do it like that. Back-patch to 9.5 to match related server fixes. In principle we could probably go back further with these changes, but given lack of field complaints I doubt it's worthwhile. Discussion: https://postgr.es/m/CAOYf6ec-TmRYjKBXLLaGaB-jrd=mjG1Hzn1a1wufUAR39PQYhw@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/4247db62522fafd1d4c045c5a432f50f2f05c0e0 Modified Files -------------- doc/src/sgml/libpq.sgml | 3 ++- src/bin/psql/common.c | 4 +++- src/interfaces/ecpg/ecpglib/execute.c | 5 +++-- src/interfaces/libpq/fe-exec.c | 3 +++ src/test/examples/testlibpq2.c | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Client-side fixes for delayed NOTIFY receipt. @ 2018-10-20 02:23 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2018-10-20 02:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Client-side fixes for delayed NOTIFY receipt. PQnotifies() is defined to just process already-read data, not try to read any more from the socket. (This is a debatable decision, perhaps, but I'm hesitant to change longstanding library behavior.) The documentation has long recommended calling PQconsumeInput() before PQnotifies() to ensure that any already-arrived message would get absorbed and processed. However, psql did not get that memo, which explains why it's not very reliable about reporting notifications promptly. Also, most (not quite all) callers called PQconsumeInput() just once before a PQnotifies() loop. Taking this recommendation seriously implies that we should do PQconsumeInput() before each call. This is more important now that we have "payload" strings in notification messages than it was before; that increases the probability of having more than one packet's worth of notify messages. Hence, adjust code as well as documentation examples to do it like that. Back-patch to 9.5 to match related server fixes. In principle we could probably go back further with these changes, but given lack of field complaints I doubt it's worthwhile. Discussion: https://postgr.es/m/CAOYf6ec-TmRYjKBXLLaGaB-jrd=mjG1Hzn1a1wufUAR39PQYhw@mail.gmail.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d30d27a52818ac863ba91bf9342fc9e8d466e30a Modified Files -------------- doc/src/sgml/libpq.sgml | 3 ++- src/bin/psql/common.c | 4 +++- src/interfaces/ecpg/ecpglib/execute.c | 5 +++-- src/interfaces/libpq/fe-exec.c | 3 +++ src/test/examples/testlibpq2.c | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Client-side fixes for delayed NOTIFY receipt. @ 2018-10-20 02:23 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2018-10-20 02:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Client-side fixes for delayed NOTIFY receipt. PQnotifies() is defined to just process already-read data, not try to read any more from the socket. (This is a debatable decision, perhaps, but I'm hesitant to change longstanding library behavior.) The documentation has long recommended calling PQconsumeInput() before PQnotifies() to ensure that any already-arrived message would get absorbed and processed. However, psql did not get that memo, which explains why it's not very reliable about reporting notifications promptly. Also, most (not quite all) callers called PQconsumeInput() just once before a PQnotifies() loop. Taking this recommendation seriously implies that we should do PQconsumeInput() before each call. This is more important now that we have "payload" strings in notification messages than it was before; that increases the probability of having more than one packet's worth of notify messages. Hence, adjust code as well as documentation examples to do it like that. Back-patch to 9.5 to match related server fixes. In principle we could probably go back further with these changes, but given lack of field complaints I doubt it's worthwhile. Discussion: https://postgr.es/m/CAOYf6ec-TmRYjKBXLLaGaB-jrd=mjG1Hzn1a1wufUAR39PQYhw@mail.gmail.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ecc59e31a81e34f4e6c0d9e73d8992d13f12b051 Modified Files -------------- doc/src/sgml/libpq.sgml | 3 ++- src/bin/psql/common.c | 4 +++- src/interfaces/ecpg/ecpglib/execute.c | 5 +++-- src/interfaces/libpq/fe-exec.c | 3 +++ src/test/examples/testlibpq2.c | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Client-side fixes for delayed NOTIFY receipt. @ 2018-10-20 02:23 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2018-10-20 02:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Client-side fixes for delayed NOTIFY receipt. PQnotifies() is defined to just process already-read data, not try to read any more from the socket. (This is a debatable decision, perhaps, but I'm hesitant to change longstanding library behavior.) The documentation has long recommended calling PQconsumeInput() before PQnotifies() to ensure that any already-arrived message would get absorbed and processed. However, psql did not get that memo, which explains why it's not very reliable about reporting notifications promptly. Also, most (not quite all) callers called PQconsumeInput() just once before a PQnotifies() loop. Taking this recommendation seriously implies that we should do PQconsumeInput() before each call. This is more important now that we have "payload" strings in notification messages than it was before; that increases the probability of having more than one packet's worth of notify messages. Hence, adjust code as well as documentation examples to do it like that. Back-patch to 9.5 to match related server fixes. In principle we could probably go back further with these changes, but given lack of field complaints I doubt it's worthwhile. Discussion: https://postgr.es/m/CAOYf6ec-TmRYjKBXLLaGaB-jrd=mjG1Hzn1a1wufUAR39PQYhw@mail.gmail.com Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/34aad21cbf03fd0d49e7322efdd18c9bf692f53d Modified Files -------------- doc/src/sgml/libpq.sgml | 3 ++- src/bin/psql/common.c | 4 +++- src/interfaces/ecpg/ecpglib/execute.c | 5 +++-- src/interfaces/libpq/fe-exec.c | 3 +++ src/test/examples/testlibpq2.c | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Client-side fixes for delayed NOTIFY receipt. @ 2018-10-20 02:23 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2018-10-20 02:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Client-side fixes for delayed NOTIFY receipt. PQnotifies() is defined to just process already-read data, not try to read any more from the socket. (This is a debatable decision, perhaps, but I'm hesitant to change longstanding library behavior.) The documentation has long recommended calling PQconsumeInput() before PQnotifies() to ensure that any already-arrived message would get absorbed and processed. However, psql did not get that memo, which explains why it's not very reliable about reporting notifications promptly. Also, most (not quite all) callers called PQconsumeInput() just once before a PQnotifies() loop. Taking this recommendation seriously implies that we should do PQconsumeInput() before each call. This is more important now that we have "payload" strings in notification messages than it was before; that increases the probability of having more than one packet's worth of notify messages. Hence, adjust code as well as documentation examples to do it like that. Back-patch to 9.5 to match related server fixes. In principle we could probably go back further with these changes, but given lack of field complaints I doubt it's worthwhile. Discussion: https://postgr.es/m/CAOYf6ec-TmRYjKBXLLaGaB-jrd=mjG1Hzn1a1wufUAR39PQYhw@mail.gmail.com Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ac3be116a79855b8a61c0efccd1c26470e8dbeef Modified Files -------------- doc/src/sgml/libpq.sgml | 3 ++- src/bin/psql/common.c | 4 +++- src/interfaces/ecpg/ecpglib/execute.c | 5 +++-- src/interfaces/libpq/fe-exec.c | 3 +++ src/test/examples/testlibpq2.c | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2018-10-20 02:23 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-10-20 02:23 pgsql: Client-side fixes for delayed NOTIFY receipt. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-20 02:23 pgsql: Client-side fixes for delayed NOTIFY receipt. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-20 02:23 pgsql: Client-side fixes for delayed NOTIFY receipt. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-20 02:23 pgsql: Client-side fixes for delayed NOTIFY receipt. Tom Lane <tgl@sss.pgh.pa.us> 2018-10-20 02:23 pgsql: Client-side fixes for delayed NOTIFY receipt. 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