-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Termination tasks with eventlet/gevent worker pool. #4019
Comments
have you any suggested workarounds? |
+1 |
I believe the issue am facing while terminating the task has to do with this feature request Am using the celery [
I believe the killing would be possible using |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
send PR, +1 will be blocked |
+1 |
+1 |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
Well, this https://celery.readthedocs.io/en/latest/reference/celery.contrib.abortable.html can be useful. You can try to abort your task from outside (set state to ABORTED) and check this state in task with some period, if state is ABORTED you can raise some Exception. What do you think about this? |
+1 @AlphaCaprice I tried this approach. I was not able to stop the process from outside. Everything is related to gevent third party app. |
considering that we are going to move to python3.6+ asyncio/trio can we close this issue as won't fix?? |
I found a workaround. Might not work for everyone though. I had a loop that had to run a heavy process. Couldn't revoke the task so the entire loop ran. So before starting the task, I made a file(let's say task_id.txt) and put a logic to check if the file existed on every iteration. I could delete the testfile if I wanted to revoke and the logic would raise an exception. This is similar to AbortableTask as in the current iteration will still run, but was a work around as I couldn't use AbortableTask in my case. |
Sadly, yes. No one has fixed this so far so it probably won't get fixed. |
+100 |
+1 |
2 similar comments
+1 |
+1 |
This is a feature request about ability to terminate task execution when using eventlet or gevent TaskPool.
Now this feature presents only on Prefork TaskPool, but, I think, this is a useful feature for other Pools.
The text was updated successfully, but these errors were encountered: