Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/valkey-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -4169,7 +4169,6 @@ static void clusterManagerOptimizeAntiAffinity(clusterManagerNodeArray *ipnodes,
"for anti-affinity\n");
int node_len = cluster_manager.nodes->len;
int maxiter = 500 * node_len; // Effort is proportional to cluster size...
srand(time(NULL));
while (maxiter > 0) {
int offending_len = 0;
if (offenders != NULL) {
Expand Down Expand Up @@ -5741,7 +5740,6 @@ static clusterManagerNode *clusterManagerNodePrimaryRandom(void) {
}

assert(primary_count > 0);
srand(time(NULL));
idx = rand() % primary_count;
listRewind(cluster_manager.nodes, &li);
while ((ln = listNext(&li)) != NULL) {
Expand Down Expand Up @@ -8419,8 +8417,6 @@ static void pipeMode(void) {
char magic[20]; /* Special reply we recognize. */
time_t last_read_time = time(NULL);

srand(time(NULL));

/* Use non blocking I/O. */
if (anetNonBlock(aneterr, context->fd) == ANET_ERR) {
fprintf(stderr, "Can't set the socket in non blocking mode: %s\n", aneterr);
Expand Down Expand Up @@ -9261,7 +9257,6 @@ static void LRUTestMode(void) {
long long start_cycle;
int j;

srand(time(NULL) ^ getpid());
while (1) {
/* Perform cycles of 1 second with 50% writes and 50% reads.
* We use pipelining batching writes / reads N times per cycle in order
Expand Down Expand Up @@ -9481,6 +9476,7 @@ int main(int argc, char **argv) {
int firstarg;
struct timeval tv;

srand(time(NULL) ^ getpid());
memset(&config.sslconfig, 0, sizeof(config.sslconfig));
config.conn_info.hostip = sdsnew("127.0.0.1");
config.conn_info.hostport = 6379;
Expand Down
Loading