-
Notifications
You must be signed in to change notification settings - Fork 753
Conversation
FUNC_TIMEOUT env not being set in deployment spec. How timeout can be configured? |
the idea is to execute |
i see. Was not aware of |
Multiprocessing is a pretty heavyweight way to add a timeout - you're forking a new process and reserialising the request and response objects for every function call. A. Do we care about performance? |
With Python's Global interpretter Lock and bottle, threading is useless anyway. If not for timeout we do need better way for parallel execution. |
I will try to do it with threads |
Perhaps this is out of conext of this bug. I opened #435 for consideration pythons |
@anguslees I tried with threads but there is not an official way of terminating threads (and seems that is something wrong to do: https://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread-in-python). If we don't terminate the function it will keep using the container resources until it fails. I tried as well using a I am reverting to the previous approach with processes, it is the only way of properly terminating the process if it takes more than N seconds. |
* Maximum timeout for python functions * Fix image reference * Fix unit test * Fix pubsub34 test and fix it * Use threads instead of processes * Adapt unit test * Revert "Adapt unit test" This reverts commit b2434c9. * Revert "Use threads instead of processes" This reverts commit 045dcdd. * Increase timeout to 180s * Fix unit test
Issue Ref: #365
Summary:
This PR adds a timeout handler for the Python runtime. If a function takes more than 3 seconds on its execution the subprocess get killed. The timeout is configurable using the environment variable FUNC_TIMEOUT.
Also, to avoid duplicated
kubeless.py
files (from python-2.7 and python-3.4 folders) they are now hard links.TODOs: