qgis-js icon indicating copy to clipboard operation
qgis-js copied to clipboard

Loading a WMS/WMTS layer causes infinite loop

Open wonder-sk opened this issue 2 years ago • 1 comments

If the QGIS project uses a WMS / WMTS layer, the project loading will get stuck, with this warning being emitted all the time:

QEventLoop::WaitForMoreEvents is not supported on the main thread without asyncify

This is likely due to the fact that the WMS provider is doing a synchronous blocking GetCapabilities call in the constructor.

wonder-sk avatar Sep 26 '23 13:09 wonder-sk

Given that we're using QGIS 3.32 in the builds, we could try to add QgsProviderMetadata::ParallelCreateProvider to WMS metadata (QgsWmsProviderMetadata::providerCapabilities()) to get the provider loaded in a worker thread, rather than creating it in the main thread. (But we'll probably still be affected by networking issues as in #3)

wonder-sk avatar Nov 06 '23 11:11 wonder-sk