diff options
author | Raghavendra G <rgowdapp@redhat.com> | 2013-12-23 14:54:05 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-01-28 22:46:35 -0800 |
commit | bae348ef599463a974781083a5999991dbb8ecbb (patch) | |
tree | e06f56c0db5d2138769f791a11e4c4e9bee02a88 /rpc | |
parent | 53ac35ebd24cffa420a73c3b2ab43c994c9b7861 (diff) |
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 <rgowdapp@redhat.com>
BUG: 969461
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-on: http://review.gluster.org/6572
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/6820
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index f9df4ac1d1e..efbc5316272 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; |