Skip to content

Commit

Permalink
When receiving a SIGTERM supervisors should terminate their processes…
Browse files Browse the repository at this point in the history
… before joining them (#1069)
  • Loading branch information
sgsabbage committed Jul 30, 2021
1 parent b93d387 commit de53c23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions uvicorn/supervisors/basereload.py
Expand Up @@ -75,6 +75,7 @@ def restart(self) -> None:
self.process.start()

def shutdown(self) -> None:
self.process.terminate()
self.process.join()
message = "Stopping reloader process [{}]".format(str(self.pid))
color_message = "Stopping reloader process [{}]".format(
Expand Down
1 change: 1 addition & 0 deletions uvicorn/supervisors/multiprocess.py
Expand Up @@ -64,6 +64,7 @@ def startup(self) -> None:

def shutdown(self) -> None:
for process in self.processes:
process.terminate()
process.join()

message = "Stopping parent process [{}]".format(str(self.pid))
Expand Down

0 comments on commit de53c23

Please sign in to comment.