Channels: Daphne not cleaning up unix socket and does not bind to unix socket if previous file exists

Created on 25 May 2017  路  3Comments  路  Source: django/channels

In our deployed environment, we find that daphne does not always bind to the unix socket correctly. Cases where I've seen it not bind:

  • On shutdown, daphne does not remove the socket or lock from /var/sockets/daphne.sock or /var/sockets/daphne.sock.lock
  • On startup, if there is already a socket at /var/sockets/daphne.sock, daphne will not bind, but will startup without an error message.

For now we are reverting to using ports, but if unix sockets would work more reliably, we'd switch back (and prefer to switch back) in the future.

We are running daphne via supervisord in a debian-based docker container (python-2.7).

blockeneeds-investigation bug exbeginner

Most helpful comment

Just came across this problem, also in docker. Deleting the files is a workaround.

All 3 comments

Daphne just uses the Twisted endpoint syntax to listen to a UNIX socket, so it's possible there's a cleanup step from that we're missing, or that's it's a bug in the Twisted endpoint core. This will need some investigation.

Closing due to age and rewrite of the code involved - if this is still an issue, please re-open it on the Daphne issue tracker.

Just came across this problem, also in docker. Deleting the files is a workaround.

Was this page helpful?
0 / 5 - 0 ratings