django / django/daphne

Implement Graceful Shutdown / Connection Draining

Open
#177 21 comments 2 reactions 0 assignees View on GitHub
enhancement exp/advanced
Dominant language
Python
Stars
2.7k
Forks
292
Avg merge
2d 15h
Merged PRs (30d)
3

Description

This was present in the old version of Channels. The changelog says:

0.9.4 (2016-03-08)
------------------

* Worker processes now exit gracefully (finish their current processing) when
sent SIGTERM or SIGINT.

This is no longer the case.

With the new architecture in Channels 2 this ability will need to be moved to Daphne. Daphne can not stop running. It will need some kind of API to reload new code while continuing to service existing connections on the old processes.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no files, tests, or entry points. Start by reviewing Daphne's current process and connection lifecycle, then compare it with the cited Channels 0.9.4 behavior. Done would require an agreed design and implementation for graceful SIGTERM/SIGINT shutdown, connection draining, and code reload while existing connections remain served.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.