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

Fix uvicorn gunicorn worker class restarts when USR1 is issued #1565

Merged
merged 2 commits into from Aug 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions uvicorn/workers.py
Expand Up @@ -72,6 +72,10 @@ def init_signals(self) -> None:
for s in self.SIGNALS:
signal.signal(s, signal.SIG_DFL)

signal.signal(signal.SIGUSR1, self.handle_usr1)
# Don't let SIGUSR1 disturb active requests by interrupting system calls
signal.siginterrupt(signal.SIGUSR1, False)

async def _serve(self) -> None:
self.config.app = self.wsgi
server = Server(config=self.config)
Expand Down