From f05607fe05f7189dc65a6f328f83db0cbb946426 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Mon, 23 Dec 2013 14:54:05 +0530 Subject: mgmt/glusterd: make sure quota enforcer has established connection with quotad before marking quota as enabled. without this patch there is a window of time when quota is marked as enabled in quota-enforcer, but connection to quotad wouldn't have been established. Any checklimit done during this period can result in a failed fop because of unavailability of quotad. Change-Id: I0d509fabc434dd55ce9ec59157123524197fcc80 Signed-off-by: Raghavendra G BUG: 969461 Signed-off-by: Raghavendra G Reviewed-on: http://review.gluster.org/6572 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- rpc/rpc-transport/socket/src/socket.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'rpc') diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index c6b293be4..490fe8a7e 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -3341,6 +3341,34 @@ reconfigure (rpc_transport_t *this, dict_t *options) priv->windowsize = (int)windowsize; + if (dict_get (this->options, "non-blocking-io")) { + optstr = data_to_str (dict_get (this->options, + "non-blocking-io")); + + if (gf_string2boolean (optstr, &tmp_bool) == -1) { + gf_log (this->name, GF_LOG_ERROR, + "'non-blocking-io' takes only boolean options," + " not taking any action"); + tmp_bool = 1; + } + + if (!tmp_bool) { + priv->bio = 1; + gf_log (this->name, GF_LOG_WARNING, + "disabling non-blocking IO"); + } + } + + if (!priv->bio) { + ret = __socket_nonblock (priv->sock); + if (ret == -1) { + gf_log (this->name, GF_LOG_WARNING, + "NBIO on %d failed (%s)", + priv->sock, strerror (errno)); + goto out; + } + } + ret = 0; out: return ret; -- cgit