Skip to content

Redis lost connection does not seem to get re-created #2072

Open

Description

@Sh4d1

Hello, when running sequin in k8s, it seems every time my redis restarts, sequin gets blocked I and I get these errors :

Last message: {:phoenix, :async_result, {:start, {#Reference<0.0.3396227.629622195.1249705985.119942>, nil, :consumers_task, {:exit, {{:badmatch, {:error, %Sequin.Error.ServiceError{code: "no_connection", message: "[redis]: No connection to Redis", service: :redis, details: nil}}}, [{SequinWeb.SinkConsumersLive.Index, :"-load_consumer_metrics/1-fun-0-", 1, [file: ~c"lib/sequin_web/live/sink_consumers/index.ex", line: 168]}, {Enum, :"-map/2-lists^map/1-1-", 2, [file: ~c"lib/enum.ex", line: 1714]}, {Map, :new_from_enum, 2, [file: ~c"lib/map.ex", line: 262]}, {SequinWeb.SinkConsumersLive.Index, :load_consumers, 3, [file: ~c"lib/sequin_web/live/sink_consumers/index.ex", line: 147]}, {Phoenix.LiveView.Async, :do_async, 5, [file: ~c"lib/phoenix_live_view/async.ex", line: 220]}, {Task.Supervised, :invoke_mfa, 2, [file: ~c"lib/task/supervised.ex", line: 101]}]}}}}} line=2646 pid=<0.26533.0> file=gen_server.erl domain=otp
[error] [08:25:01.621] Redis error while trying to acquire mutex: {:error, %Sequin.Error.ServiceError{code: "no_connection", message: "[redis]: No connection to Redis", service: :redis, details: nil}} line=25 pid=<0.20162.0> file=lib/sequin/mutex.ex domain=elixir application=sequin mutex_key=sequin:mutexed_supervisor:prod:Elixir.Sequin.Runtime.MutexedSupervisor

It gets unblocked when I restart the sequin pod. I'm using sequin v0.13.14

Activity

  1. Sh4d1 commented on Sep 10, 2025

    @Sh4d1
    Author

    @RTLS is this expected ? 🤔

  2. deleted a comment from dosubot on Dec 23, 2025
  3. added a commit that references this issue on Mar 26, 2026
    94b8fae
  4. isaacrowntree commented on Jun 12, 2026

    @isaacrowntree

    For anyone still hitting this: the root cause is MutexOwner returning an invalid gen_statem value on Redis errors, which crashes it and takes down all consumers via the :one_for_all supervisor. A fix (retry with capped exponential backoff, re-acquire on recovery) was submitted as #2131 but upstream appears unmaintained since Feb 2026 — it's now merged and released in the maintained fork: https://github.com/triptechtravel/sequin (v0.14.6-tt2, ghcr.io/triptechtravel/sequin:v0.14.6-tt2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions