troubleshooting modpy - modrpc/info GitHub Wiki

Calling ModPy coroutines in a non-coroutine

Use thr_ API.

Hangs

ModPy runtime solely uses coroutines to schedule execution of multiple ModPy resources and processes. This means that non-preemptive cooperative scheduling is used. If there is any resource or process which does not yield its control, then the whole runtime can hang. A simple example:

 @modpy.func
 def foo():
   while True:
     pass
   return
Call to above function will make the ModPy node hang forever.

Currently, there is no way to exit from this hang.

How to isolate resources

Currently, there is no way to solve the hang problem. However, there are a few workarounds. For example, consider creating mutiple worker nodes and let one router node. router ModPy module contains implementation of router.

⚠️ **GitHub.com Fallback** ⚠️