You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Author Name: Min Min (Min Min)
Original Redmine Issue: 19630
Affected QGIS version: 3.0.3
Redmine category:python_plugins
User Feedback
crash when using QThreadPool + QRunnable in plugin
no GUI updating function is executed in QRunnable. QRunnable writes data to local file, create a QgsVectorLayer, getFeatures, fields, addFeatures, addAttributes (fields) to QgsVectorLayer/QgsDataProvider. When editing, QMutex and QMutexLocker is used.
tasks assigned to QThreadPool has finished sucessfully, QThreadPool.activeThreadCount() returns 0
QGIS Info
QGIS Version: 3.0.3-Girona
QGIS code revision: 8a899c8
Compiled against Qt: 5.9.2
Running against Qt: 5.9.2
Compiled against GDAL: 2.2.4
Running against GDAL: 2.2.4
System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.15063
The text was updated successfully, but these errors were encountered:
Error caused by reading feature from a QgsVectorLayer in a QThread. As QgsVectorLayer use QgsConnectionPool for fetching feature, and QgsConnectionPool is singleton and always run in main thread (not thread-safe)
timerEvent in Stack Trace is caused by this connection pool. Whether this is a bug, or by design is unclear.
It's not safe to fetch features directly from a thread - you need to first obtain the feature iterator in the main thread, and then interested over the features in the spawned thread.
Author Name: Min Min (Min Min)
Original Redmine Issue: 19630
Affected QGIS version: 3.0.3
Redmine category:python_plugins
User Feedback
crash when using QThreadPool + QRunnable in plugin
no GUI updating function is executed in QRunnable. QRunnable writes data to local file, create a QgsVectorLayer, getFeatures, fields, addFeatures, addAttributes (fields) to QgsVectorLayer/QgsDataProvider. When editing, QMutex and QMutexLocker is used.
tasks assigned to QThreadPool has finished sucessfully, QThreadPool.activeThreadCount() returns 0
After tasks finished around 30-60 sec, QGIS crash
Report Details
Crash ID: a279b085a2ce54c5ff69e8b1e03c403266d4bf00
Stack Trace
QGIS Info
QGIS Version: 3.0.3-Girona
QGIS code revision: 8a899c8
Compiled against Qt: 5.9.2
Running against Qt: 5.9.2
Compiled against GDAL: 2.2.4
Running against GDAL: 2.2.4
System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.15063
The text was updated successfully, but these errors were encountered: