[QGIS-Developer] Cancelling a running processing model
Nyall Dawson
nyall.dawson at gmail.com
Thu Aug 13 02:40:41 PDT 2020
On Thu, 13 Aug 2020 at 19:28, Julien Cabieces
<julien.cabieces at oslandia.com> wrote:
>
>
> 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.
Just to add to this comprehensive answer -- some providers don't have
any support for canceling algorithms mid-way. The GDAL algorithms
especially are a problem with this, because you can easily fire off a
process which will take hours to complete and have no way to cancel it
apart from killing the qgis session.
(It's totally fixable, just a matter of finding time!)
Nyall
>
> > 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
>
> _______________________________________________
> 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