diff --git a/src/peers.c b/src/peers.c index 89d193d24..295b0eccf 100644 --- a/src/peers.c +++ b/src/peers.c @@ -2896,6 +2896,15 @@ struct task *process_peer_sync(struct task * task, void *context, unsigned int s if (!stopping) { /* Normal case (not soft stop)*/ + /* resync timeout set to TICK_ETERNITY means we just start + * a new process and timer was not initialized. + * We must arm this timer to switch to a request to a remote + * node if incoming connection from old local process never + * comes. + */ + if (peers->resync_timeout == TICK_ETERNITY) + peers->resync_timeout = tick_add(now_ms, MS_TO_TICKS(PEER_RESYNC_TIMEOUT)); + if (((peers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMLOCAL) && (!nb_oldpids || tick_is_expired(peers->resync_timeout, now_ms)) && !(peers->flags & PEERS_F_RESYNC_ASSIGN)) {