[QGIS-Developer] Cancelling a running processing model

Julien Cabieces julien.cabieces at oslandia.com
Thu Aug 13 02:21:24 PDT 2020


Hi

> Hi, 
>
> I am working with processing models these days - and depending on the
> data amounts, the algorithms run quite long. 
>
> I noticed that although there is a "Cancel" button, this button has no
> effect during the execution of one single algorithm that takes a long
> time. Only after the execution of this single algorithm, then the
> subsequent algorithms are cancelled. So if, e.g. a buffer algorithm
> takes 5 minutes to execute and it is just one part of the whole model,
> then if the user presses cancel during the execution of this buffer
> algorithm, then he has to wait until the buffer algorithm finishes. Is
> this observation correct?

No, you can interrupt an algorithm during its execution, but each algorithm
has to check if the user has canceled regularly during the
execution (here for the buffer algorithm for instance:
https://github.com/qgis/QGIS/blob/master/src/analysis/processing/qgsalgorithmbuffer.cpp#L122)

So the time you'll have to wait to finish once you have clicked on the Cancel
button depends on the algorithm itself.

Regarding the buffer algorithm, it could be that the processing is
taking a long time to make the final unaryUnion (in cas of dissolve) at
the end of the processing where isCanceled is not checked.

>
> Note that I am using 3.10, not 3.14 or the latest master - maybe
> something has improved in this respect in later versions? 
>
> If nothing was improved in this respect - is there a chance to improve
> the situation in the future? 
>

I don't think there's a magic solution, it depends on which algorithm
you estimate too slow to interrupt.

> Thanks for the discussion, 
>
> Andreas_______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



More information about the QGIS-Developer mailing list