Skip to content

Commit

Permalink
Revert "Allow command timeout to be set"
Browse files Browse the repository at this point in the history
This only works for async I/O
  • Loading branch information
arr2036 committed Mar 19, 2024
1 parent 7a70f5d commit 41e7a90
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
9 changes: 0 additions & 9 deletions raddb/mods-available/redis
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ redis {
#
# use_cluster_map = yes

#
# command_timeout:: The maximum time allowed for an individual command to execute
#
# Setting to 0.0 disables the timeout.
#
# Default is 0.0
#
# command_timeout = 0

# lua { ... }::
#
# Configuration options which control the execution of lua scripts
Expand Down
8 changes: 1 addition & 7 deletions src/lib/redis/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
*/
RCSIDH(redis_h, "$Id$")

#include <freeradius-devel/util/time.h>

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/map.h>
#include <freeradius-devel/server/module.h>
Expand Down Expand Up @@ -123,9 +121,6 @@ typedef struct {
uint32_t max_retries; //!< Maximum number of times we attempt a command
//!< when receiving successive -TRYAGAIN messages.
uint32_t max_alt; //!< Maximum alternative nodes to try.

fr_time_delta_t command_timeout; //!< How long to wait for commands to return.

fr_time_delta_t retry_delay; //!< How long to wait when we received a -TRYAGAIN
//!< message.
fr_time_delta_t connection_timeout;
Expand All @@ -145,8 +140,7 @@ typedef struct {
{ FR_CONF_OFFSET_FLAGS("password", CONF_FLAG_SECRET, fr_redis_conf_t, password) }, \
{ FR_CONF_OFFSET("max_nodes", fr_redis_conf_t, max_nodes), .dflt = "20" }, \
{ FR_CONF_OFFSET("max_alt", fr_redis_conf_t, max_alt), .dflt = "3" }, \
{ FR_CONF_OFFSET("max_redirects", fr_redis_conf_t, max_redirects), .dflt = "2" }, \
{ FR_CONF_OFFSET("command_timeout", fr_redis_conf_t, reconnection_delay), .dflt = "0" }
{ FR_CONF_OFFSET("max_redirects", fr_redis_conf_t, max_redirects), .dflt = "2" }

void fr_redis_version_print(void);

Expand Down
7 changes: 0 additions & 7 deletions src/lib/redis/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1481,13 +1481,6 @@ void *fr_redis_cluster_conn_create(TALLOC_CTX *ctx, void *instance, fr_time_delt
return NULL;
}

/*
* Sets a timeout for synchronous command evaluation
*/
if (fr_time_delta_cmp(node->cluster->conf->command_timeout, fr_time_delta_from_sec(0)) != 0) {
redisSetTimeout(handle, fr_time_delta_to_timeval(node->cluster->conf->command_timeout));
}

conn = talloc_zero(ctx, fr_redis_conn_t);
conn->handle = handle;
conn->node = node;
Expand Down

0 comments on commit 41e7a90

Please sign in to comment.