[postgis-tickets] [SCM] PostGIS branch master updated. 3.2.0-783-g042894569
git at osgeo.org
git at osgeo.org
Mon May 2 00:31:39 PDT 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via 0428945693d284ae085f2fe3d4ea2764eba2c62c (commit)
from 8176e19e224cfea712acee283b23cfe95bb2cd3d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0428945693d284ae085f2fe3d4ea2764eba2c62c
Author: sergei sh <sshoulbakov at kontur.io>
Date: Tue Apr 26 20:13:49 2022 +0300
using ExecutorStart_hook to reset interrupt flags
Add to NEWS
Closes https://github.com/postgis/postgis/pull/685
Closes #5137
diff --git a/NEWS b/NEWS
index 3b84e8795..951636335 100644
--- a/NEWS
+++ b/NEWS
@@ -43,7 +43,7 @@ PostGIS 3.3.0dev
- #5123, PG15 now exposes json types and functions, no need
to include for PG15+ (Regina Obe)
- #5088, Memory corruption in mvt_agg_transfn (Victor Collod)
-
+ - #5137, resetting interrupt flags before query execution (Sergei Shoulbakov)
PostGIS 3.2.0 (Olivier Courtin Edition)
2021/12/17
diff --git a/deps/wagyu/lwgeom_wagyu.cpp b/deps/wagyu/lwgeom_wagyu.cpp
index a25a0d189..0afbd144b 100644
--- a/deps/wagyu/lwgeom_wagyu.cpp
+++ b/deps/wagyu/lwgeom_wagyu.cpp
@@ -264,3 +264,9 @@ lwgeom_wagyu_interruptRequest()
{
mapbox::geometry::wagyu::interrupt_request();
}
+
+void
+lwgeom_wagyu_interruptReset()
+{
+ mapbox::geometry::wagyu::interrupt_reset();
+}
diff --git a/deps/wagyu/lwgeom_wagyu.h b/deps/wagyu/lwgeom_wagyu.h
index 738ecee46..9e557f679 100644
--- a/deps/wagyu/lwgeom_wagyu.h
+++ b/deps/wagyu/lwgeom_wagyu.h
@@ -59,6 +59,11 @@ const char *libwagyu_version();
*/
void lwgeom_wagyu_interruptRequest();
+/**
+ * Cancels request to stop processing.
+ */
+void lwgeom_wagyu_interruptReset();
+
#ifdef __cplusplus
}
#endif
diff --git a/postgis/postgis_module.c b/postgis/postgis_module.c
index 764244bc4..1018b92ca 100644
--- a/postgis/postgis_module.c
+++ b/postgis/postgis_module.c
@@ -25,6 +25,7 @@
#include "postgres.h"
#include "fmgr.h"
+#include "executor/executor.h"
#include "utils/elog.h"
#include "utils/guc.h"
#include "libpq/pqsignal.h"
@@ -54,6 +55,9 @@ static void interruptCallback() {
}
#endif
+static ExecutorStart_hook_type onExecutorStartPrev = NULL;
+static void onExecutorStart(QueryDesc *queryDesc, int eflags);
+
/*
* Module load callback
*/
@@ -70,6 +74,10 @@ _PG_init(void)
/* install PostgreSQL handlers */
pg_install_lwgeom_handlers();
+
+ /* setup hooks */
+ onExecutorStartPrev = ExecutorStart_hook;
+ ExecutorStart_hook = onExecutorStart;
}
/*
@@ -81,6 +89,9 @@ _PG_fini(void)
{
elog(NOTICE, "Goodbye from PostGIS %s", POSTGIS_VERSION);
pqsignal(SIGINT, coreIntHandler);
+
+ /* restore original hooks */
+ ExecutorStart_hook = onExecutorStartPrev;
}
@@ -107,3 +118,21 @@ handleInterrupt(int sig)
(*coreIntHandler)(sig);
}
}
+
+static void onExecutorStart(QueryDesc *queryDesc, int eflags) {
+ /* cancel interrupt requests */
+
+ GEOS_interruptCancel();
+
+#ifdef HAVE_LIBPROTOBUF
+ lwgeom_wagyu_interruptReset();
+#endif
+
+ lwgeom_cancel_interrupt();
+
+ if (onExecutorStartPrev) {
+ (*onExecutorStartPrev)(queryDesc, eflags);
+ } else {
+ standard_ExecutorStart(queryDesc, eflags);
+ }
+}
-----------------------------------------------------------------------
Summary of changes:
NEWS | 2 +-
deps/wagyu/lwgeom_wagyu.cpp | 6 ++++++
deps/wagyu/lwgeom_wagyu.h | 5 +++++
postgis/postgis_module.c | 29 +++++++++++++++++++++++++++++
4 files changed, 41 insertions(+), 1 deletion(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list