Explorar el Código

fix(keepalive): keepalive init with right recv_oct

zhongwencool hace 4 años
padre
commit
abc0a3526e
Se han modificado 3 ficheros con 2 adiciones y 8 borrados
  1. 0 3
      apps/emqx/etc/emqx.conf
  2. 1 1
      apps/emqx/src/emqx_keepalive.erl
  3. 1 4
      apps/emqx/src/emqx_schema.erl

+ 0 - 3
apps/emqx/etc/emqx.conf

@@ -649,9 +649,6 @@ mqtt {
 
   ## The backoff for MQTT keepalive timeout. The broker will kick a connection out
   ## until 'Keepalive * backoff * 2' timeout.
-  ## There is one exception:
-  ## If the client connects successfully and then does not send any more packets,
-  ## it will be kicked out until 'Keepalive * backoff * 3'.
   ##
   ## @doc mqtt.keepalive_backoff
   ## ValueType: Float

+ 1 - 1
apps/emqx/src/emqx_keepalive.erl

@@ -39,7 +39,7 @@
 -spec(init(Interval :: non_neg_integer()) -> keepalive()).
 init(Interval) when Interval > 0 ->
     #keepalive{interval = Interval,
-               statval  = 0,
+               statval  = emqx_pd:get_counter(incoming_bytes),
                repeat   = 0}.
 
 %% @doc Get Info of the keepalive.

+ 1 - 4
apps/emqx/src/emqx_schema.erl

@@ -364,10 +364,7 @@ This feature is disabled if is set to \"\"."""
           #{default => 0.75,
             desc =>
 """The backoff for MQTT keepalive timeout. The broker will kick a connection out
-until 'Keepalive * backoff * 2' timeout.
-There is one exception:
-If the client connects successfully and then does not send any more packets,
-it will be kicked out until 'Keepalive * backoff * 3'."""
+until 'Keepalive * backoff * 2' timeout."""
            })
       }
     , {"max_subscriptions",