Opened 10 years ago

Closed 10 years ago

#2893 closed enhancement (fixed)

ST_Segmentize is not interruptible

Reported by: zenitram Owned by: strk
Priority: medium Milestone: PostGIS 2.2.0
Component: postgis Version: 2.1.x
Keywords: Cc:

Description

This query:

SELECT ST_Segmentize(ST_MakeLine(ST_MakePoint(4,39), ST_MakePoint(1,41)),
1e-100);

is not interruptible and doesn't get killed by the statement_timeout or manual cancellation requests.

I'm using this version:

POSTGIS="2.1.3 r12547" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6
March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.7.8"
LIBJSON="UNKNOWN" RASTER

Probably related to #1802 #1799

Change History (10)

comment:1 by robe, 10 years ago

Owner: changed from pramsey to strk

comment:2 by robe, 10 years ago

Milestone: PostGIS 2.1.4PostGIS 2.2.0
Type: defectenhancement

This is actually an enhancement as strk noted in #1802. We don't currently support interruptablility of built-in functions (just GEOS ones). Pushing to 2.2. We can try to do in 2.1 if it doesn't require too much rearrangement of the code base.

comment:3 by strk, 10 years ago

Doesn't require too much rearrangement of code base. We do support interruptability of ANALYZE, for example.

comment:4 by robe, 10 years ago

Milestone: PostGIS 2.2.0PostGIS 2.1.4

Okay since it doesn't require an API change we could push into next 2.1 release. I'll flip to 2.1 then.

comment:5 by robe, 10 years ago

strk would this apply for geography as well? (and would it be limited to just ST_Segmentize or all our liblwgeom native funcs?). We might need to change this ticket title if so.

comment:6 by strk, 10 years ago

Nn a second though, while this change does not affect the SQL api, it would affect the liblwgeom one. Not sure what the target would be anyway.

comment:7 by robe, 10 years ago

Milestone: PostGIS 2.1.4PostGIS 2.2.0

okay switched back to 2.2

comment:8 by strk, 10 years ago

Status: newassigned

I hadn't checked geography but I'd guess it would possibly affect all liblwgeom functions. Generally, it takes a liblwgeom enhancement to be able to provide an interruptability call. I'm on it.

comment:9 by strk, 10 years ago

r13099 (in trunk) adds interruptability API to liblwgeom and its usage from postgis module. I'll move on to hook ST_Segmentize code onto the new API. Any other long-running code should be checked for being interruptable, or hooked on the API too.

comment:10 by strk, 10 years ago

Resolution: fixed
Status: assignedclosed

r13105 makes use of the interruptibility API (extended) from PostGIS's ST_Segmentize function, fixing this ticket.

The geography version seems to fail earlier, with this message: ERROR: invalid memory alloc request size 1073741824

Note: See TracTickets for help on using tickets.