Bug report #14764

Commit "Pass the full ogr data source URI as connInfo in qgsConnectionPool_ConnectionCreate" cancels the benefits of OGR connection pooling

Added by Even Rouault over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:Sandro Mani
Category:Data Provider/OGR
Affected QGIS version:2.14.2 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:22721

Description

79493ea, done per #14560, (that was also cherry picked in 2.14 branch as c913e83, and got in the 2.14.2 OSGeo4W Windows binaries despite being after the git final-2_14_2 tag, as OSGeo4W 2.14.2-1 is actually built from f5763f0 as the help dialog box confirms it) has the side effect of disabling in practice the benefits of OGR connection pooling added in b4f4663. That can be seen by a lot of dataset opening and closing with CPL_DEBUG=ON when scrolling through the attribute table, or zooming-in/out/panning on the map canvas.
The reason is that QgsOgrProvider::QgsOgrProvider() calls QgsOgrConnPool::instance()->ref() / unref() on the filepath whereas QgsOgrFeatureSource on the datasource URI.

(I'm wondering if another option to 79493ea would have perhaps just be to call OGR_L_ResetReading(ogrlayer) after acquiring the connection and the layer)

History

#1 Updated by Jürgen Fischer over 8 years ago

  • Category set to Data Provider/OGR

#2 Updated by Sandro Mani over 8 years ago

Argh. Thanks for reporting this.

As a quick fix, I've submitted https://github.com/qgis/QGIS/pull/3057.

I'll need to look at OGR_L_ResetReading(ogrlayer).

#3 Updated by Sandro Mani over 8 years ago

  • Status changed from Open to Closed

Fixed in master and backported to 2.14 branch.

#4 Updated by Jürgen Fischer over 8 years ago

OSGeo4W packages rebuilt from tag and standalone installers updated (2.14.2-2)

Also available in: Atom PDF