Skip to content

I unplugged the network cable, why ConnectionMultiplexer.IsConnected is true #1822

Closed

Description

@skyxioo

I unplugged the network cable, why ConnectionMultiplexer.IsConnected is true

Activity

  1. mrmartan commented on Aug 13, 2021

    @mrmartan

    Since AFAICT there is no mechanism to detect broken TCP socket in this library. Unless the remote end sends a TCP reset. And that does not happen in case of HW failures (or simulated VM ones, e.g. we disabled VM network card). Then your client TCP handling comes in. We are using Linux. And on Linux there is a kernel setting /proc/sys/net/ipv4/tcp_retries2 which results to your TCP socket being reset on the client side in ranges of tens of minutes. Which is a serious problem for any serious Redis use.

    You can decrease the setting, e.g. setting it to 3 makes SE.Redis reconnect almost immediately. The problem with that solution is that it is kernel setting affecting the entire machine, in our case that would be Kubernetes worker nodes. I have not found any way to tweak this per process, nor a dotnet runtime setting.

    https://access.redhat.com/solutions/726753

  2. mrmartan commented on Aug 13, 2021

    @mrmartan
  3. NickCraver commented on Jan 5, 2022

    @NickCraver
    Collaborator

    We have a heartbeat in play, but depending on your system configuration (especially on some Linux distros) this can take a while for sockets to fail - that's an artifact of system configuration for all libraries though.

  4. NickCraver commented on Feb 8, 2022

    @NickCraver
    Collaborator

    Happy to reopen if there are follow-up questions here - closing for now to tidy up :)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions