Skip to content
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

Cluster shuts down immediately after processing tasks #367

Closed
wgordon17 opened this issue Jun 10, 2019 · 3 comments
Closed

Cluster shuts down immediately after processing tasks #367

wgordon17 opened this issue Jun 10, 2019 · 3 comments

Comments

@wgordon17
Copy link
Contributor

Versions

django-q==1.0.1
Django==2.1.5
macOS 10.14.5
psql (PostgreSQL) 10.6

Settings

Q_CLUSTER = {
    'workers': 1,
    'sync': False
    'timeout': 3600,
    'save_limit': 5,
    'orm': 'default'
}

Running manage.py qcluster with 1 task produces the following

22:29:10 [Q] INFO Q Cluster-19244 starting.
22:29:10 [Q] INFO Process-1 guarding cluster at 19249
22:29:10 [Q] INFO Q Cluster-19244 running.
22:29:10 [Q] INFO Process-1:1 ready for work at 19250
22:29:10 [Q] INFO Process-1:2 monitoring at 19251
22:29:10 [Q] INFO Process-1:3 pushing tasks at 19252
22:29:10 [Q] INFO Process-1:1 processing [eleven-bravo-summer-jig]
22:29:11 [Q] INFO Processed [eleven-bravo-summer-jig]
22:29:13 [Q] INFO Q Cluster-19244 stopping.
22:29:13 [Q] INFO Process-1 stopping cluster processes
22:29:13 [Q] INFO Process-1:3 stopped pushing tasks
22:29:14 [Q] INFO Process-1:1 stopped doing work
22:29:14 [Q] INFO Process-1:2 stopped monitoring results
22:29:14 [Q] INFO Process-1 waiting for the monitor.
22:29:14 [Q] INFO Q Cluster-19244 has stopped.

Running manage.py qcluster with 0 tasks produces the following

23:39:51 [Q] INFO Q Cluster-19965 starting.
23:39:52 [Q] INFO Process-1 guarding cluster at 19970
23:39:52 [Q] INFO Q Cluster-19965 running.
23:39:52 [Q] INFO Process-1:1 ready for work at 19971
23:39:52 [Q] INFO Process-1:2 monitoring at 19972
23:39:52 [Q] INFO Process-1:3 pushing tasks at 19973
23:39:55 [Q] INFO Q Cluster-19965 stopping.
23:39:55 [Q] INFO Process-1 stopping cluster processes
23:39:55 [Q] INFO Process-1:3 stopped pushing tasks
23:39:55 [Q] INFO Process-1:1 stopped doing work
23:39:56 [Q] INFO Process-1:2 stopped monitoring results
23:39:56 [Q] INFO Process-1 waiting for the monitor.
23:39:56 [Q] INFO Q Cluster-19965 has stopped.
@wgordon17
Copy link
Contributor Author

😱 For anyone else that comes across this issue...it was PyCharm debug that was breaking this. I have no idea why...but on a hunch, I ran the configuration with Run instead of Debug, and TADA, it worked! 🤷‍♂

@jeroenbrouwer
Copy link

To get this working in the Pycharm debugger make sure in preferences you have checked the Gevent compatible checkbox! That fixed this problem for me.

@steg87
Copy link

steg87 commented Jul 10, 2020

Problem occurs for VS Code as well. Solution is to add "gevent": true to launch configuration for qcluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants