Skip to content

Commit 067e40c

Browse files
committed
Do a CHECK_FOR_INTERRUPTS immediately before terminating a fastpath
function call. Previously, there may have been no CHECK_FOR_INTERRUPTS at all in the fastpath code path, making it impossible to cancel an operation such as \lo_import externally. This addition doesn't ensure you can cancel, since your SIGINT may arrive while the backend is idle waiting for the client, but it gives the largest window we can easily provide. Noted while experimenting with new control-C code for psql.
1 parent aa30e0e commit 067e40c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/tcop/fastpath.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.87 2006/06/11 15:49:28 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.88 2006/06/14 01:24:14 tgl Exp $
1212
*
1313
* NOTES
1414
* This cruft is the server side of PQfn.
@@ -382,6 +382,9 @@ HandleFunctionRequest(StringInfo msgBuf)
382382
retval = (Datum) 0;
383383
}
384384

385+
/* ensure we do at least one CHECK_FOR_INTERRUPTS per function call */
386+
CHECK_FOR_INTERRUPTS();
387+
385388
SendFunctionResult(retval, fcinfo.isnull, fip->rettype, rformat);
386389

387390
return 0;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy