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

Circus stop only stops first process #155

Closed
Eagllus opened this issue Mar 14, 2016 · 3 comments
Closed

Circus stop only stops first process #155

Eagllus opened this issue Mar 14, 2016 · 3 comments

Comments

@Eagllus
Copy link
Collaborator

Eagllus commented Mar 14, 2016

I have a project running with circus.
When I tell circusctl stop django-q it returns ok but during ps aux | grep qcluster I notice 1 process stopped (the main process) but the children are still running.

28686  0.0  0.3 142600 36740 ?        Sl   09:29   0:00 /project/virtualenv/bin/python ./manage.py qcluster
28687  0.0  0.3 141848 34048 ?        S    09:29   0:00 /project/virtualenv/bin/python ./manage.py qcluster
28688  0.0  0.3 141852 34056 ?        S    09:29   0:00 /project/virtualenv/bin/python ./manage.py qcluster
28689  0.0  0.3 141856 34060 ?        S    09:29   0:00 /project/virtualenv/bin/python ./manage.py qcluster
28690  0.0  0.3 141860 34052 ?        S    09:29   0:00 /project/virtualenv/bin/python ./manage.py qcluster
28691  0.0  0.3 141864 34064 ?        S    09:29   0:00 /project/virtualenv/bin/python ./manage.py qcluster
28692  0.0  0.3 141868 34068 ?        S    09:29   0:00 /project/virtualenv/bin/python ./manage.py qcluster
28693  0.0  0.3 141872 34072 ?        S    09:29   0:00 /project/virtualenv/bin/python ./manage.py qcluster
28694  0.0  0.3 141872 35516 ?        S    09:29   0:00 /project/virtualenv/bin/python ./manage.py qcluster
28695  2.0  0.3 142128 36424 ?        Sl   09:29   0:24 /project/virtualenv/bin/python ./manage.py qcluster

Any idea why this is happening?

@Eagllus
Copy link
Collaborator Author

Eagllus commented Mar 14, 2016

Here are my circus configuration.

My circus.ini

[circus]
pubsub_endpoint = tcp://0.0.0.0:5556
endpoint = tcp://0.0.0.0:5555
include_dir = /etc/circus/conf.d
check_delay = 5
stats_endpoint = tcp://127.0.0.1:5557
logoutput=/var/log/circus/circusd.log

[plugin:flapping]
use = circus.plugins.flapping.Flapping
max_retry = 2
retry_in = 3

My project.ini

[watcher:project]
cmd=/usr/local/pyenv/versions/3.4.2/bin/uwsgi --uwsgi-socket /var/run/project/uwsgi.sock --pidfile /var/run/project/uwsgi.pid
working_dir=/project/
autostart=True
stop_children=True
uid=project
graceful_timeout=60
stdout_stream.class = WatchedFileStream
stdout_stream.filename = /project/shared/log/project.stdout.log
stderr_stream.class = WatchedFileStream
stderr_stream.filename = /project/log/project.stderr.log

[env:project]
HOME=/project
DJANGO_SETTINGS_MODULE=project.settings.production
UWSGI_MODULE=project.wsgi:application
UWSGI_HOME=/project/virtualenv
UWSGI_CHDIR=/project
UWSGI_HARIKIRI=60
UWSGI_MAX_REQUESTS=5000
UWSGI_MASTER=true
UWSGI_PROCESSES=5
UWSGI_PYTHONPATH=/project
UWSGI_VACUUM=true
UWSGI_CHMOD_SOCKET=666

[watcher:project-queue]
cmd=/project/virtualenv/bin/python ./manage.py qcluster
working_dir=/project
autostart=True
stop_children=True
uid=commandcontrol_p
graceful_timeout=60
numprocesses = 1
copy_env = True
stdout_stream.class = WatchedFileStream
stdout_stream.filename = /project/log/project-queue.stdout.log
stderr_stream.class = WatchedFileStream
stderr_stream.filename = /project/log/project-queue.stderr.log

[env:project-queue]
HOME=/project
DJANGO_SETTINGS_MODULE=project.settings.production

@Koed00
Copy link
Owner

Koed00 commented Mar 14, 2016

First thing I notice is stop_children=True. This should definitely be off/false, cause that will detach the children from the main process and break the shutdown sequence. The children will ignore any direct stop messages not coming from the main process. So you end up having to kill them.

@Eagllus
Copy link
Collaborator Author

Eagllus commented Mar 14, 2016

I removed the stop_children=True command and this fixed it!
Thank you for the fast response

@Eagllus Eagllus closed this as completed Mar 14, 2016
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

2 participants