Skip to content

Commit ed55ff8

Browse files
committed
BUG/MINOR: peers: make sure to always apply offsets to now_ms in expiration
Now_ms can be zero nowadays, so it's not suitable for direct assignment to t->expire, as there's a risk that the timer never wakes up once assigned (TICK_ETERNITY). Let's use tick_add(now_ms, 0) for an immediate wakeup instead. The impact here might be a reconnect programmed upon signal receipt at the wrapping date not having a working timeout. This should be backported where it applies.
1 parent f66bfcf commit ed55ff8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/peers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3609,7 +3609,7 @@ static void __process_stopping_peer_sync(struct task *task, struct peers *peers,
36093609

36103610
/* Set resync timeout for the local peer and request a immediate reconnect */
36113611
peers->resync_timeout = tick_add(now_ms, MS_TO_TICKS(PEER_RESYNC_TIMEOUT));
3612-
peers->local->reconnect = now_ms;
3612+
peers->local->reconnect = tick_add(now_ms, 0);
36133613
}
36143614
}
36153615

0 commit comments

Comments
 (0)