Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Postgis: Concurrency problem with CursorResultSet #1588

Closed
rcoup opened this Issue · 5 comments

3 participants

@rcoup
Collaborator

From https://groups.google.com/d/topic/mapnik/1yqMtPw8VRI/discussion

while trying to implement parallelism with asynchronous queries (#849), I ran into a curious thing in the Postgis plugin.

In the function features() implemented in postgis_datasource.cpp, the first thing done is to borrow a connection from the connection pool. Later, the method get_resultset is called with this connection, and if the datasource is supposed to use a cursor, it returns a CursorResultSet object, with the connection. Then the connection is given back to the pool, thanks to the PoolGuard.

The strange thing is that the CursorResultSet still uses the connection (in method getNextResultSet, called by next) after it has been given back. Am I right ?

Does somebody use postgis cursors in a concurrency context ? Has anybody ever had issues with that ?

Looks valid to me after a review

@lexman

Hello,

we've started working on parallelization of datasource queries, which fixes this bug. It is not in the master and still needs some work to be merged, but you can have a look at our repo : https://github.com/Mappy/mapnik/tree/parallel_queries , and comments about the code : Mappy#1

@springmeyer
Owner

excellent, thanks for the update!

@springmeyer
Owner

@rcoup - had a chance to work on this yet?

@rcoup
Collaborator

Fixed by #1823

@rcoup rcoup closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.