27 RCSIDH(pool_h,
"$Id: 7f02e5682a89ad8d15be72afd8331064df14611d $")
40 #include <freeradius-devel/server/stats.h>
136 char const *log_prefix);
#define CC_RELEASE_HANDLE(_tag)
#define CC_ACQUIRE_HANDLE(_tag)
A section grouping multiple CONF_PAIR.
static fr_time_delta_t timeout
fr_time_t last_failed
Last time we tried to spawn a connection but failed.
fr_time_delta_t fr_pool_timeout(fr_pool_t *pool)
Connection pool get timeout.
int fr_pool_start(fr_pool_t *pool)
fr_time_t last_closed
Last time a connection was closed.
fr_time_t last_throttled
Last time we refused to spawn a connection because the last connection failed, or we were already spa...
uint32_t active
Number of currently reserved connections.
fr_time_t last_released
Last time a connection was released.
void const * fr_pool_opaque(fr_pool_t *pool)
Return the opaque data associated with a connection pool.
fr_time_delta_t next_delay
The next delay time.
void fr_pool_free(fr_pool_t *pool)
Delete a connection pool.
void fr_pool_ref(fr_pool_t *pool)
Increment pool reference by one.
fr_pool_state_t const * fr_pool_state(fr_pool_t *pool)
Get the number of connections currently in the pool.
int fr_pool_reconnect(fr_pool_t *pool, request_t *request)
Mark connections for reconnection, and spawn at least 'start' connections.
void * fr_pool_connection_reconnect(fr_pool_t *pool, request_t *request, CC_RELEASE_HANDLE("conn_pool_handle") void *conn)
fr_time_t last_checked
Last time we pruned the connection pool.
void * fr_pool_connection_get(fr_pool_t *pool, request_t *request)
Reserve a connection in the connection pool.
void(* fr_pool_reconnect_t)(fr_pool_t *pool, void *opaque)
Alter the opaque data of a connection pool during reconnection event.
uint64_t count
Number of connections spawned over the lifetime of the pool.
fr_time_t last_held_min
Last time we warned about a low latency event.
fr_time_t last_at_max
Last time we hit the maximum number of allowed connections.
void *(* fr_pool_connection_create_t)(TALLOC_CTX *ctx, void *opaque, fr_time_delta_t timeout)
Create a new connection handle.
uint32_t pending
Number of pending open connections.
void fr_pool_connection_release(fr_pool_t *pool, request_t *request, CC_RELEASE_HANDLE("conn_pool_handle") void *conn)
fr_time_t last_spawned
Last time we spawned a connection.
fr_time_t last_held_max
Last time we warned about a high latency event.
bool reconnecting
We are currently reconnecting the pool.
uint32_t num
Number of connections in the pool.
int(* fr_pool_connection_alive_t)(void *opaque, void *connection)
Check a connection handle is still viable.
int fr_pool_start_num(fr_pool_t *pool)
Connection pool get start.
void fr_pool_enable_triggers(fr_pool_t *pool, char const *trigger_prefix, fr_pair_list_t *trigger_args)
Enable triggers for a connection pool.
fr_pool_t * fr_pool_init(TALLOC_CTX *ctx, CONF_SECTION const *cs, void *opaque, fr_pool_connection_create_t c, fr_pool_connection_alive_t a, char const *log_prefix)
Create a new connection pool.
fr_pool_t * fr_pool_copy(TALLOC_CTX *ctx, fr_pool_t *pool, void *opaque)
Allocate a new pool using an existing one as a template.
int fr_pool_connection_close(fr_pool_t *pool, request_t *request, CC_RELEASE_HANDLE("conn_pool_handle") void *conn)
void fr_pool_reconnect_func(fr_pool_t *pool, fr_pool_reconnect_t reconnect)
Set a reconnection callback for the connection pool.
A time delta, a difference in time measured in nanoseconds.