How to Avoid GIL holding functions

Blockquote
Event loop was unresponsive in Worker for 9.25s. This is often caused by long-running GIL-holding functions or moving large chunks of data. This can cause timeouts and instability.

I see this warning a lot of time but not sure what functions hold the GIL and how to avoid then as this is present even when reading a file

Hi @S1234,

Would you be able to share an example of this warning occuring when reading a file?

This warning occurs when you run Python code inside tasks that are blocking the whole Worker event loop because of GIL.