Skip to content

Commit

Permalink
Fix uvicorn gunicorn worker class restarts when USR1 is issued (#1565)
Browse files Browse the repository at this point in the history
* Fix uvicorn gunicorn worker class restarts when USR1 is issued

* Remove comment
  • Loading branch information
wonjoonSeol-WS committed Aug 26, 2022
1 parent ccd1aae commit e4e65b9
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit e4e65b9

Please sign in to comment.