/* reset teaching and learning flags to 0 */
peer->flags &= PEER_TEACH_RESET;
peer->flags &= PEER_LEARN_RESET;
- /* set this peer as dead from heartbeat point of view */
- peer->flags &= ~PEER_F_ALIVE;
task_wakeup(peers->sync_task, TASK_WOKEN_MSG);
}
HA_SPIN_LOCK(PEER_LOCK, &peer->lock);
if (peer->appctx == appctx)
__peer_session_deinit(peer);
+ peer->flags &= ~PEER_F_ALIVE;
HA_SPIN_UNLOCK(PEER_LOCK, &peer->lock);
}
}
{
struct shared_table *st;
+ peer->heartbeat = tick_add(now_ms, MS_TO_TICKS(PEER_HEARTBEAT_TIMEOUT));
/* Register status code */
peer->statuscode = PEER_SESS_SC_SUCCESSCODE;
peer->last_hdshk = now_ms;
{
struct shared_table *st;
+ peer->heartbeat = tick_add(now_ms, MS_TO_TICKS(PEER_HEARTBEAT_TIMEOUT));
/* Init cursors */
for (st = peer->tables; st ; st = st->next) {
st->last_get = st->last_acked = 0;
*/
curpeer->reconnect = tick_add(now_ms, MS_TO_TICKS(50 + ha_random() % 2000));
peer_session_forceshutdown(curpeer);
+ curpeer->heartbeat = TICK_ETERNITY;
curpeer->coll++;
}
if (maj_ver != (unsigned int)-1 && min_ver != (unsigned int)-1) {
}
}
curpeer->appctx = appctx;
+ curpeer->flags |= PEER_F_ALIVE;
appctx->ctx.peers.ptr = curpeer;
appctx->st0 = PEER_SESS_ST_SENDSUCCESS;
_HA_ATOMIC_ADD(&active_peers, 1);
struct stream *s;
peer->reconnect = tick_add(now_ms, MS_TO_TICKS(PEER_RECONNECT_TIMEOUT));
- peer->heartbeat = tick_add(now_ms, MS_TO_TICKS(PEER_HEARTBEAT_TIMEOUT));
+ peer->heartbeat = TICK_ETERNITY;
peer->statuscode = PEER_SESS_SC_CONNECTCODE;
peer->last_hdshk = now_ms;
s = NULL;
}
else {
ps->reconnect = tick_add(now_ms, MS_TO_TICKS(50 + ha_random() % 2000));
+ ps->heartbeat = TICK_ETERNITY;
peer_session_forceshutdown(ps);
ps->no_hbt++;
}