I think I am seeing rare deadlocks or some other kind of crash/freeze of Orthanc when uploading a large .zip archive via the REST API. I think this happens when another REST API call to a Python Plug-in is made while that one is in progress. It is hard to pin down because it happens so rarely.
I did notice this in the book. I am using the 4.x version of the Python Plug-in.
Warning
In releases <= 3.0 of the Python plugin, deadlocks might emerge if you call other core primitives of Orthanc (such as the REST API) in your callback function. This issue has been fixed in release 3.1.
As a temporary workaround against such deadlocks in releases <= 3.0, if you have to call other primitives of Orthanc, you should make these calls in a separate thread, passing the pending events to be processed through a message queue. Here is the template of a possible solution to postpone such deadlocks as much as possible by relying on the multithreading primitives of Python:
Is there a way in the 4.x version of the plug-in to avoid this ? It may be that it is not related to the code but to some other issue with the configuration of the server and system. I ran into a similar issue a few months ago and what seemed to fix that was making the API calls from a webapp to the native endpoints in orthanc rather than executing the same from one or more Pyhon Plug-in scripts.
There are some other settings I can play around with, like:
ORTHANC__POSTGRESQL__INDEX_CONNECTIONS_COUNT=4
ORTHANC__POSTGRESQL__MAXIMUM_CONNECTION_RETRIES=16
This installation is a small one, so also kind of wondering if I even need more than one connection.
Stephen D. Scotti