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

Gunicorn[UVLoop]WebWorker doesn’t call worker_int and worker_abort callback #1202

Closed
hynek opened this issue Sep 21, 2016 · 4 comments
Closed
Labels

Comments

@hynek
Copy link
Contributor

@hynek hynek commented Sep 21, 2016

Long story short

gunicorn defines two callbacks that are called after receiving SIGINT/SIGQUIT & SIGABRT. Gunicorn[UVLoop]WebWorker call them.

Expected behaviour

The callbacks get called.

Actual behaviour

The callbacks don't get called.

Proposed fix

Call the callbacks like gunicorn.workers.base.Worker does:

    def handle_quit(self, sig, frame):
        self.alive = False
        # worker_int callback
        self.cfg.worker_int(self)
        time.sleep(0.1)
        sys.exit(0)

    def handle_abort(self, sig, frame):
        self.alive = False
        self.cfg.worker_abort(self)
        sys.exit(1)
@1st1
Copy link
Contributor

@1st1 1st1 commented Oct 5, 2016

Hi, could you please try this with uvloop 0.5.4? I've completely reimplemented how signals are handled (now it's exactly the same same as to how asyncio handles them).

@hynek
Copy link
Contributor Author

@hynek hynek commented Oct 6, 2016

This too is unrelated since it happens even without uvloop. :)

I don’t think I’ve actually opened an issue about uvloop masking out sigterm which indeed is fixed, thanks!

@fafhrd91
Copy link
Member

@fafhrd91 fafhrd91 commented Nov 22, 2016

fixed by #1420

@fafhrd91 fafhrd91 closed this Nov 22, 2016
@lock
Copy link

@lock lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.