Select to view content in your preferred language

Custom toolbox Arcpy script keeps running even after complete execution

324
3
10-17-2024 03:36 AM
rohanrajan_hms
Regular Contributor

Good Day,

I am working on a custom arcpy toolbox. My tool keeps running and showing 'Updating' even after the code is executed completely and successfully till the last line. 

Is there any procedure to properly terminate code in such arcpy scripts. 

Any advice will be much appreciated. 

Thank you in advance

 

rohanrajan_hms_1-1729161335264.png

 

 

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

what does your code do?

How does it increment and do you reset it when it reaches the end of the cycle?

SetProgressor—ArcGIS Pro | Documentation 


... sort of retired...
0 Kudos
HaydenWelch
MVP

The "Updating..." progressor state isn't controlled by Progressor calls from arcpy. It's usually done when progress state isn't implemented in a geoprocessing tool/function call or when the ArcGISPro thread takes over from the script to preform cleanup. I've seen it hang when making lots of edits and lock files get out of sync in file geodatabases.

Usually by the time you see this the actual script completed successfully, but the thread running the python tool remains locked for some reason.

0 Kudos
HaydenWelch
MVP

I've noticed that this tends to happen when you run an arcpy tool function. I believe that the handling of those calls is passed on to a different thread as those directly run tools written in C# or Java.

You could always try interrupting by raising an Exception then immediately catching that exception to exit the execute() call.

 

Without seeing the call that's causing the Updating hangup it's hard to tell though.

0 Kudos