rdma:setting rdma REUSEADDR flag to rdma id.
When we restart the process, it will go TIME_WAIT state to make sure that all the data in the transport is successfully delivered. REUSEADDR allows server to bind to an address which is in TIME_WAIT state. Change-Id: Ic7deb0d7442c29494fe088598ffe9c87977c04ff Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/9005 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
This commit is contained in:
parent
f3f7f2a204
commit
f6b9f29504
@ -4389,6 +4389,7 @@ gf_rdma_listen (rpc_transport_t *this)
|
||||
int ret = 0;
|
||||
gf_rdma_ctx_t *rdma_ctx = NULL;
|
||||
char service[NI_MAXSERV], host[NI_MAXHOST];
|
||||
int optval = 2;
|
||||
|
||||
priv = this->private;
|
||||
peer = &priv->peer;
|
||||
@ -4430,6 +4431,15 @@ gf_rdma_listen (rpc_transport_t *this)
|
||||
|
||||
sprintf (this->myinfo.identifier, "%s:%s", host, service);
|
||||
|
||||
ret = rdma_set_option(peer->cm_id, RDMA_OPTION_ID,
|
||||
RDMA_OPTION_ID_REUSEADDR,
|
||||
(void *)&optval, sizeof(optval));
|
||||
if (ret != 0) {
|
||||
gf_log (this->name, GF_LOG_WARNING,
|
||||
"rdma option set failed (%s)", strerror (errno));
|
||||
goto err;
|
||||
}
|
||||
|
||||
ret = rdma_bind_addr (peer->cm_id, &sock_union.sa);
|
||||
if (ret != 0) {
|
||||
gf_log (this->name, GF_LOG_WARNING,
|
||||
|
Loading…
x
Reference in New Issue
Block a user