Closed shosti closed 7 years ago
FWIW I played around with ignoring the :disconnected
message (https://github.com/phoenixframework/phoenix_pubsub_redis/commit/a2df8080930f1c0849525e283c9e980bdf32202e), but the effect is still the same. The reason is here: Redis errors get translated directly to BroadcastError
s in the PubSub.
I'm not super familiar with how Phoenix PubSub works under the hood, but IIUC netsplits within a PG2 group don't lead to BroadcastError
s in that way. Does it make sense to treat a redis disconnection like a netsplit? If so maybe connection errors should be ignored (or handled in a way other than a BroadcastError
)?
Steps to reproduce:
mix phoenix.gen.presence
and add the appropriate supervisormix phoenix.server
(Exact dependency versions: https://gist.github.com/shosti/46c73d522cc2c58997ccc5d28bdfa629 + Redis 3.2.4.)
Expected results
I was expecting it to attempt to reconnect until Redis comes back online (which IIUC is basically analogous to the behavior of the PG2 adapter).
Actual results
Once a heartbeat message is broadcast, a string of errors leads to total app shutdown: https://gist.github.com/shosti/8c82beee34fd994b6e9fa53d9625cf4d .
It looks like the problem is an unhandled function clause, but it may just be a matter of adjusting restart policies (let me know if that's the case).