[postgis-tickets] [PostGIS] #3145: ST_StraightSkeleton is uninterruptible

PostGIS trac at osgeo.org
Thu Sep 27 01:15:30 PDT 2018


#3145: ST_StraightSkeleton is uninterruptible
--------------------------+-----------------------------
  Reporter:  strk         |      Owner:  colivier
      Type:  enhancement  |     Status:  new
  Priority:  medium       |  Milestone:  PostGIS Fund Me
 Component:  sfcgal       |    Version:  trunk
Resolution:               |   Keywords:
--------------------------+-----------------------------

Comment (by strk):

 PostGIS module code takes care of intercepting interruption
 requests from user, see postgis/postgis_module.c

 The handleInterrupt function currently calls a GEOS
 API meant to deal with interruption: GEOS_interruptRequest
 (and another exposed by liblwgeom...)

 What we need here is one function to request interruption
 in SFCGAL, to be called from there.

 Interruptibility API was added in GEOS from version 3.4.0,
 released in August 2013.

 The GEOS API allows setting a flag which is checked by
 GEOS code at regular intervals. It may not be the best
 approach (polling) but it works fine, and is what PostgreSQL
 is also suggesting modules to use internally.

 In GEOS, if you want to check it, we drop a call to a macro
 in loops here and there:

   #define GEOS_CHECK_FOR_INTERRUPTS() geos::util::Interrupt::process()

 The function checks if the flag is set or not, the API allows
 setting or clearing that flag.

 I think the alternative would be directly handling sigint but
 for some reason we decided not to do that (I forgot what the
 reason was, maybe you can check in changeset history)

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3145#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list