dblink doesn't honor interrupts while waiting a result - Mailing list pgsql-hackers

From Florian G. Pflug
Subject dblink doesn't honor interrupts while waiting a result
Date
Msg-id 47C239E7.4080002@phlo.org
Whole thread Raw
Responses Re: dblink doesn't honor interrupts while waiting a result  ("Marko Kreen" <markokr@gmail.com>)
Re: dblink doesn't honor interrupts while waiting a result  (Decibel! <decibel@decibel.org>)
List pgsql-hackers
Hi

dblink in 8.3 blocks without any possibility of interrupting it while
waiting for an answer from the remote server. Here is a strace
[pid 27607] rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_IGN}, 8) = 0
[pid 27607] sendto(56, "Q\0\0\0008lock table travelhit.booking_code in 
exclusive mode\0", 57, 0, NULL, 0) = 57
[pid 27607] rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_IGN}, 8) = 0
[pid 27607] poll([{fd=56, events=POLLIN|POLLERR}], 1, -1) = ? 
ERESTART_RESTARTBLOCK (To be restarted)
[pid 27607] --- SIGTERM (Terminated) @ 0 (0) ---
[pid 27607] rt_sigreturn(0xf)           = -1 EINTR (Interrupted system call)
[pid 27607] poll(

As you can see I'm trying to lock the table travelhit.booking_code, 
which blocks because someone else is already holding that lock. When
I send a SIGTERM to the backend, the poll() syscalll is interruped -
but immediatly restarted.

I'm not sure how a proper fix for this could look like, since the 
blocking actually happens inside libpq - but this certainly makes 
working with dblink painfull...

regards, Florian Pflug


pgsql-hackers by date:

Previous
From: Mark Mielke
Date:
Subject: Re: insert ... delete ... returning ... ?
Next
From: "Pavan Deolasee"
Date:
Subject: Re: pg_dump additional options for performance