Notebooks in ArcGIS Online Skipping Runs

712
3
05-19-2021 04:44 AM
JasonJordan00
Occasional Contributor

I have notebook running in our AGOL site every 15 minutes. The code is pretty simple, only takes about 10 seconds to run.  However, there's been a few times in the last week since it started where it sits in 'executing' status for 4 to 6 hours so all the runs in that time are skipped. I'm thinking it might just being hanging while trying to connect to the AGOL. Is there a way to force the next iteration to run instead of skipping? Or shutdown the Notebook if it runs for more than ~2 minutes?

0 Kudos
3 Replies
jcarlson
MVP Esteemed Contributor

There is a python module multiprocessing, which is available in the AGOL Notebook environment, that can handle this. By running a parallel "timer" process, you can force-quit your notebook if it runs long.

See this Stack Overflow answer  that gives a nice example. I don't work extensively with multiprocessing myself, and have not tested this in a Notebook setting specifically, but it's a place to start.

- Josh Carlson
Kendall County GIS
wwnde
by
Occasional Contributor

It basically depends on what lines it is skipping. Sharing a code snippet would have been useful. I had a similar issue where I was generating centroids and wanting to use centroid coordinates. What I did was to ensure the centroids are written on portal and on the consequent run, the code would search for the new write and utilize it. In other instances, I introduced sleep time to make sure latency was covered for. See code snippet below

wwnde_0-1622180122890.png

 

 

0 Kudos
RobertAkroyd1
New Contributor III

@JasonJordan00 I have found the same thing too.  See my reply to the post here: https://community.esri.com/

0 Kudos