Motr  M0
conn_pool.h File Reference
#include "rpc/conn.h"
#include "rpc/session.h"
#include "rpc/rpc_machine.h"
#include "rpc/link.h"
Include dependency graph for conn_pool.h:

Go to the source code of this file.

Data Structures

struct  m0_rpc_conn_pool_item
 
struct  m0_rpc_conn_pool
 

Macros

#define __MOTR_RPC_CONN_POOL_H__
 

Functions

M0_INTERNAL int m0_rpc_conn_pool_init (struct m0_rpc_conn_pool *pool, struct m0_rpc_machine *rpc_mach, m0_time_t conn_timeout, uint64_t max_rpcs_in_flight)
 
M0_INTERNAL void m0_rpc_conn_pool_fini (struct m0_rpc_conn_pool *pool)
 
M0_INTERNAL int m0_rpc_conn_pool_get_sync (struct m0_rpc_conn_pool *pool, const char *remote_ep, struct m0_rpc_session **session)
 
M0_INTERNAL int m0_rpc_conn_pool_get_async (struct m0_rpc_conn_pool *pool, const char *remote_ep, struct m0_rpc_session **session)
 
M0_INTERNAL void m0_rpc_conn_pool_put (struct m0_rpc_conn_pool *pool, struct m0_rpc_session *session)
 
M0_INTERNAL struct m0_chanm0_rpc_conn_pool_session_chan (struct m0_rpc_session *session)
 
M0_INTERNAL bool m0_rpc_conn_pool_session_established (struct m0_rpc_session *session)
 
M0_INTERNAL void m0_rpc_conn_pool_destroy (struct m0_rpc_conn_pool *pool, struct m0_rpc_session *session)
 

Macro Definition Documentation

◆ __MOTR_RPC_CONN_POOL_H__

#define __MOTR_RPC_CONN_POOL_H__

Definition at line 26 of file conn_pool.h.

Function Documentation

◆ m0_rpc_conn_pool_destroy()

M0_INTERNAL void m0_rpc_conn_pool_destroy ( struct m0_rpc_conn_pool pool,
struct m0_rpc_session session 
)

Destroy this rpc session from this pool.

Destroy this rpc session from this pool.

First, the connection pool item will be identified by iterating the connection pool list and removed from the list. Then, the rpc link will be asynchronously disconnect. In the disconnection callback, we will destroy this rpc link.

Definition at line 450 of file conn_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_rpc_conn_pool_fini()

M0_INTERNAL void m0_rpc_conn_pool_fini ( struct m0_rpc_conn_pool pool)

Definition at line 345 of file conn_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_rpc_conn_pool_get_async()

M0_INTERNAL int m0_rpc_conn_pool_get_async ( struct m0_rpc_conn_pool pool,
const char *  remote_ep,
struct m0_rpc_session **  session 
)
Todo:
Potential race if connection is established before clink is added to session channel.
Todo:
Looks like rpc link connect could not be called twice, even in case first attempt fails (phase 2).

Definition at line 230 of file conn_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_rpc_conn_pool_get_sync()

M0_INTERNAL int m0_rpc_conn_pool_get_sync ( struct m0_rpc_conn_pool pool,
const char *  remote_ep,
struct m0_rpc_session **  session 
)

Definition at line 197 of file conn_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_rpc_conn_pool_init()

M0_INTERNAL int m0_rpc_conn_pool_init ( struct m0_rpc_conn_pool pool,
struct m0_rpc_machine rpc_mach,
m0_time_t  conn_timeout,
uint64_t  max_rpcs_in_flight 
)

Definition at line 325 of file conn_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_rpc_conn_pool_put()

M0_INTERNAL void m0_rpc_conn_pool_put ( struct m0_rpc_conn_pool pool,
struct m0_rpc_session session 
)

Definition at line 288 of file conn_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_rpc_conn_pool_session_chan()

M0_INTERNAL struct m0_chan* m0_rpc_conn_pool_session_chan ( struct m0_rpc_session session)

Definition at line 304 of file conn_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_rpc_conn_pool_session_established()

M0_INTERNAL bool m0_rpc_conn_pool_session_established ( struct m0_rpc_session session)
Todo:
Unprotected access to ->sm_state in this function.

Definition at line 310 of file conn_pool.c.

Here is the caller graph for this function: