Forums

Are threads blocked in scheduled tasks ?

In my scheduled task log :

File "/usr/lib/python2.7/threading.py", line 743, in start
    _start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread

I wouldn't have thought so - any chance you're creating many, many threads?

Yup, jgmdavies is right -- there's no low-level block on threads. But if you create a lot then you will hit limits. How many are you trying to create?

When I run the script from a console, it executes without a problem. When I try to run it as a task, I get : thread.error: can't start new thread

How many threads do you try to start?

Between 30 and 40.

30-40 should work for one process, but if you end up with 2 scheduled tasks running at the same time, the second will run out of threads. That's why it worked in a console - there was just one process trying to make that many threads.

Thanks.