mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-31 17:49:11 +00:00
Make server reconnect time a little bit more random
Add randomly up to 15 seconds to the reconnect delay for outgoing server links when the connection has been "short" and therefore the "ConnectRetry" delay is being enforced. This should make it even more unlikely that two servers deadlock each other when both are trying to connect to the other one at the same time, for example in test environments.
This commit is contained in:
parent
eb4f9eac0c
commit
fb92493376
@ -481,8 +481,12 @@ Conf_UnsetServer( CONN_ID Idx )
|
||||
* require the next attempt to be delayed. */
|
||||
Conf_Server[i].lasttry =
|
||||
t - Conf_ConnectRetry + RECONNECT_DELAY;
|
||||
} else
|
||||
Conf_Server[i].lasttry = t;
|
||||
} else {
|
||||
/* "Short" connection, enforce "ConnectRetry"
|
||||
* but randomize it a little bit: 15 seconds. */
|
||||
Conf_Server[i].lasttry =
|
||||
t + rand() / (RAND_MAX / 15);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user