This counter could be hugely incremented by the peer task responsible of managing
peer synchronizations and reconnections, for instance when a peer is not reachable
there is a period where the appctx is not created. If we receive stick-table
updates before the peer session (appctx) is instantiated, we reach the code
responsible of incrementing the "new_conn" counter.
With this patch we increment this counter only when we really instantiate a new
peer session thanks to peer_session_create().
May be backported as far as 2.0.
struct session *sess;
struct stream *s;
+ peer->new_conn++;
peer->reconnect = tick_add(now_ms, MS_TO_TICKS(PEER_RECONNECT_TIMEOUT));
peer->heartbeat = TICK_ETERNITY;
peer->statuscode = PEER_SESS_SC_CONNECTCODE;
/* reschedule task for reconnect */
task->expire = tick_first(task->expire, ps->reconnect);
- ps->new_conn++;
}
/* else do nothing */
} /* !ps->appctx */