Django Channels2 - after a system chrash or power failure channel name persists.

20 views
Skip to first unread message

Levent Engin

unread,
Nov 22, 2019, 7:08:46 AM11/22/19
to Django users
Hi,

I am using Django Channels2. After a system failure or power crash channel name of the receiver persists without a proper disconnect(). System sends messages to non exiting channel name (receiver).
How can we handle this situation?

BR

Levent


Adam Hooper

unread,
Nov 22, 2019, 10:06:34 AM11/22/19
to Django users
On Friday, November 22, 2019 at 7:08:46 AM UTC-5, Levent Engin wrote:
Hi,

I am using Django Channels2. After a system failure or power crash channel name of the receiver persists without a proper disconnect().

Where does the channel name persist? (Surely not on the machine that turned off....)

Be very clear on which problem you want to solve:
  • It's impossible to "fix" senders so they never send to a channel that doesn't exist. (Channels can disappear at any time, so a race is inevitable.)
  • It's possible to "expire" invalid messages so they don't impede delivery of valid messages. Tune the expiry option.
  • It's possible to "expire" a channel out of a group ... but you'll want that duration to be very long. Tune the group_expiry option.
Personally, I use RabbitMQ; I built a channel layer, https://github.com/CJWorkbench/channels_rabbitmq, that promises a better solution.

With RabbitMQ, messages destined for a disconnected host disappear immediately; and channels disappear from groups immediately (so you should set group_expiry to an enormous number).

Enjoy life,
Adam

Levent Engin

unread,
Nov 23, 2019, 6:27:06 AM11/23/19
to django...@googlegroups.com
Thx  for info.


Adam Hooper <ad...@adamhooper.com>, 22 Kas 2019 Cum, 18:07 tarihinde şunu yazdı:
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/61cc91ef-9569-4418-9e59-64788b196402%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages