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

Add field arbiter.stopping #2944

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions THANKS
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Kevin Gessner <kevin@kevingessner.com>
Kevin Littlejohn <kevin@littlejohn.id.au>
Kevin Luikens <kluikens@gmail.com>
Kirill Zaborsky <qrilka@gmail.com>
Klaas van Schelven <klaas@vanschelven.com>
Konstantin Kapustin <sirkonst@gmail.com>
kracekumar <kracethekingmaker@gmail.com>
Kristian Glass <git@doismellburning.co.uk>
Expand Down
3 changes: 3 additions & 0 deletions gunicorn/arbiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def __init__(self, app):
self.reexec_pid = 0
self.master_pid = 0
self.master_name = "Master"
self.stopping = False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure but may be is_stopping more better name for this, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably yes... but I'll wait for the more fundamental problems that @benoitc raised before dealing with the details


cwd = util.getcwd()

Expand Down Expand Up @@ -374,6 +375,8 @@ def stop(self, graceful=True):
:attr graceful: boolean, If True (the default) workers will be
killed gracefully (ie. trying to wait for the current connection)
"""
self.stopping = True

unlink = (
self.reexec_pid == self.master_pid == 0
and not self.systemd
Expand Down