Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-16030

Add heartbeat between netty server and client to detect long connection alive

    XMLWordPrintableJSON

Details

    Description

      As reported on the user mailing list

      Network can fail in many ways, sometimes pretty subtle (e.g. high ratio packet loss).  
      When the long tcp connection between netty client and server is lost, the server would failed to send response to the client, then shut down the channel. At the same time, the netty client does not know that the connection has been disconnected, so it has been waiting for two hours.

      To detect the long tcp connection alive on netty client and server, we should have two ways: tcp keepalive and heartbeat.
       
      The tcp keepalive is 2 hours by default. When the long tcp connection dead, you continue to wait for 2 hours, the netty client will trigger exception and enter failover recovery.

      If you want to detect quickly, netty provides IdleStateHandler which it use ping-pang mechanism. If netty client sends continuously n ping message and receives no one pang message, then trigger exception.
       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              begginghard Guanghui Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

                Created:
                Updated: