Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2023-01-31 Thread Andres Freund
Hi, On 2023-01-30 12:00:55 -0800, Nathan Bossart wrote: > On Mon, Jan 30, 2023 at 11:49:37AM -0800, Andres Freund wrote: > > Why don't the dblink tests catch this? Any chance you or Robins could > > prepare > > a patch with fix and test, given that you know how to trigger this? > > It's

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2023-01-30 Thread Robins Tharakan
Hi Andres, On Tue, 31 Jan 2023 at 06:31, Nathan Bossart wrote: > > On Mon, Jan 30, 2023 at 11:49:37AM -0800, Andres Freund wrote: > > Why don't the dblink tests catch this? Any chance you or Robins could > > prepare > > a patch with fix and test, given that you know how to trigger this? > >

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2023-01-30 Thread Nathan Bossart
On Mon, Jan 30, 2023 at 11:49:37AM -0800, Andres Freund wrote: > Why don't the dblink tests catch this? Any chance you or Robins could prepare > a patch with fix and test, given that you know how to trigger this? It's trivially reproducible by calling 1-argument dblink_connect() multiple times

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2023-01-30 Thread Andres Freund
Hi, On 2023-01-30 11:30:08 -0800, Nathan Bossart wrote: > On Mon, Jan 23, 2023 at 07:28:06PM -0800, Andres Freund wrote: > > After a tiny bit further polishing, and after separately pushing a resource > > leak fix for walrcv_connect(), I pushed this. > > My colleague Robins Tharakan (CC'd)

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2023-01-30 Thread Nathan Bossart
On Mon, Jan 23, 2023 at 07:28:06PM -0800, Andres Freund wrote: > After a tiny bit further polishing, and after separately pushing a resource > leak fix for walrcv_connect(), I pushed this. My colleague Robins Tharakan (CC'd) noticed crashes when testing recent commits, and he traced it back to

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2023-01-23 Thread Andres Freund
Hi, On 2023-01-20 19:00:08 -0800, Andres Freund wrote: > Updated patch attached. I split it into multiple pieces. > 1) A fix for [1], included here because I encountered it while testing > 2) Introduction of libpq-be-fe-helpers.h > 3) Convert dblink and postgres_fdw to the helper > 4) Convert

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2023-01-20 Thread Andres Freund
Hi, On 2023-01-14 14:45:06 +1300, Thomas Munro wrote: > On Tue, Jan 10, 2023 at 3:05 PM Andres Freund wrote: > > On 2023-01-03 12:05:20 -0800, Andres Freund wrote: > > > The attached patch adds libpq-be-fe-helpers.h and uses it in > > > libpqwalreceiver, > > > dblink, postgres_fdw. > > > > > As

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2023-01-13 Thread Thomas Munro
On Tue, Jan 10, 2023 at 3:05 PM Andres Freund wrote: > On 2023-01-03 12:05:20 -0800, Andres Freund wrote: > > The attached patch adds libpq-be-fe-helpers.h and uses it in > > libpqwalreceiver, > > dblink, postgres_fdw. > > > As I made libpq-be-fe-helpers.h handle reserving external fds, > >

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2023-01-09 Thread Andres Freund
Hi, On 2023-01-03 12:05:20 -0800, Andres Freund wrote: > The attached patch adds libpq-be-fe-helpers.h and uses it in libpqwalreceiver, > dblink, postgres_fdw. > As I made libpq-be-fe-helpers.h handle reserving external fds, > libpqwalreceiver now does so. I briefly looked through its users

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2023-01-03 Thread Robert Haas
On Sun, Sep 25, 2022 at 7:22 PM Andres Freund wrote: > Maybe I am missing something, but I don't think it's OK for > connect_pg_server() to connect in a blocking manner, without accepting > interrupts? I remember noticing various problems in this area years ago. I'm not sure whether I noticed

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2023-01-03 Thread Andres Freund
Hi, On 2022-12-30 14:14:55 +1300, Thomas Munro wrote: > Oh, I was imagining something slightly different. Not something under > src/include/libpq, but conceptually a separate header-only library > that is above both the backend and libpq. Maybe something like >

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2022-12-29 Thread Thomas Munro
On Fri, Dec 30, 2022 at 10:54 AM Andres Freund wrote: > On 2022-12-30 10:31:22 +1300, Thomas Munro wrote: > > On Fri, Dec 30, 2022 at 6:23 AM Andres Freund wrote: > > > On 2022-12-08 18:08:15 -0800, Andres Freund wrote: > > > > On 2022-09-25 16:22:37 -0700, Andres Freund wrote: > > > > The only

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2022-12-29 Thread Andres Freund
Hi, On 2022-12-30 10:31:22 +1300, Thomas Munro wrote: > On Fri, Dec 30, 2022 at 6:23 AM Andres Freund wrote: > > On 2022-12-08 18:08:15 -0800, Andres Freund wrote: > > > On 2022-09-25 16:22:37 -0700, Andres Freund wrote: > > > The only alternative way to provide a wrapper that I can think of are

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2022-12-29 Thread Tom Lane
Thomas Munro writes: > The header idea is a little bit sneaky (IIUC: a header that is part of > the core tree, but can't be used by core and possibly needs special > treatment in 'headercheck' to get the right include search path, can > only be used by libpqwalreceiver et al which are allowed to

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2022-12-29 Thread Thomas Munro
On Fri, Dec 30, 2022 at 6:23 AM Andres Freund wrote: > On 2022-12-08 18:08:15 -0800, Andres Freund wrote: > > On 2022-09-25 16:22:37 -0700, Andres Freund wrote: > > The only alternative way to provide a wrapper that I can think of are to > > a) introduce a new static library that can be linked to

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2022-12-29 Thread Andres Freund
Hi, On 2022-12-08 18:08:15 -0800, Andres Freund wrote: > I just re-discovered this issue, via > https://www.postgresql.org/message-id/20221209003607.bz2zdznvfnkq4zz3%40awork3.anarazel.de > > > On 2022-09-25 16:22:37 -0700, Andres Freund wrote: > > Maybe I am missing something, but I don't think

Re: postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2022-12-08 Thread Andres Freund
Hi, I just re-discovered this issue, via https://www.postgresql.org/message-id/20221209003607.bz2zdznvfnkq4zz3%40awork3.anarazel.de On 2022-09-25 16:22:37 -0700, Andres Freund wrote: > Maybe I am missing something, but I don't think it's OK for > connect_pg_server() to connect in a blocking

postgres_fdw uninterruptible during connection establishment / ProcSignalBarrier

2022-09-25 Thread Andres Freund
Hi, I amd working on adding an "installcheck" equivalent mode to the meson build. One invocation of something "installcheck-world" like lead to things getting stuck. Lots of log messages like: 2022-09-25 16:16:30.999 PDT [2705454][client backend][28/1112:41269][pg_regress] LOG: still waiting