Kriptos
Kriptos

Reputation: 11

Django Channels 4.0.0 + Docker Redis stops sending messages after some time

I am using Django 4.1.3 + Channels 4.0.0 and Docker with Redis:latest in it. It runs on Daphne 4.0.0. Also I have frontend written on React that uses reconnecting websocket for making undead connection to server. But after some time (I can’t say for sure, but about 1 - 2 days) frontend stops recieving messages from Channels.

Restarting Redis container fixes this issue as 1 - 2 days as I said.

Here is the docker-compose.yml:

services:
  ...

  redis:
    image: redis
    ports:
      - "6379:6379"
    container_name: redis
    restart: always
    command: redis-server --appendonly yes --replica-read-only no

Any thoughts what it could be and and how to fix it? Ps. thank for your time

Upvotes: 0

Views: 196

Answers (2)

cbirch
cbirch

Reputation: 130

I had a similar issue just recently and the Channels git page acknowledged it. The temporary fix until it is addressed was running version 3.4.1.

Upvotes: 0

exp3ct
exp3ct

Reputation: 11

I had a problem with the event loop closing and redis replica synchronization breaking after an arbitrary amount of time. Channels-redis got updated silently and was causing the issues, after rolling it back everything working again. So my advice would be to if channels-redis version is correct and experiment with it.

Upvotes: 0

Related Questions