AttributeError: ERROR 87934 replication and multithreading in ArcGIS Pro 2.9 arcpy

1015
1
01-18-2022 10:23 AM
by Anonymous User
Not applicable

I needed to run the Subdivide Polygon tool thousands of times, and copy the results to a new geodatabase.

In arcpy, the Subdivide Polygon tool can be run in parallel using concurrent.futures.  As far as I can tell, the output feature classes can only be written to the output geodatabase one at a time (serial) due to locking.

In the end I had to write a some blocking logic at the process level. Each process ran the Subdivide Polygon tool and then waited its turn to copy the output to the geodatabase.

The problem arose when using multithreading in the main process as well as sub processes from concurrent.futures. Any time I tried to hop threads and share Subdivide Polygon output, arcpy would crash with AttributeError: ERROR 87934.

 

What does this error actually mean?

Is it possible to write to a geodatabase in parallel?

Does arcpy allow multithreading? I'd like to know if this is an implementation problem on my end or if arcpy doesn't play well here.

 

Reference posts for AttributeError 87934: Cherrypy error, Using Cherrypy 

0 Kudos
1 Reply
by Anonymous User
Not applicable

Answering questing 3 here.

ArcObjects instances (and therefore most arcpy/arcgisscripting objects) cannot cross thread boundaries. That is, if you create an object in one thread, you cannot access it in another.