summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2010-01-23 17:37:38 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-01-23 15:16:12 -0800
commite5f49cc81a976489cb7629cdf1aacf467e9e22a5 (patch)
tree50469314780f8c1ae0dcfaa6908c70f18e10a415
parent83d1db8ee0cc79a8d5532df0d61d0efc8c1fc0a6 (diff)
protocol/client: timeout tweaks
* option frame-timeout 0 now means no frame timeout * option ping-timeout 0 now means no ping timeout * extended frame-timeout range from 0 to 1 day * extended ping-timeout range from 1 Signed-off-by: Anand V. Avati <avati@amp.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 450 (frame-timeout range should be higher) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=450 BUG: 423 (Disable protocol timeout) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=423
-rw-r--r--xlators/protocol/client/src/client-protocol.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c
index 64c3456a109..91eb6df6434 100644
--- a/xlators/protocol/client/src/client-protocol.c
+++ b/xlators/protocol/client/src/client-protocol.c
@@ -339,7 +339,7 @@ save_frame (transport_t *trans, call_frame_t *frame,
saved_frames_put (conn->saved_frames, frame, op, type, callid);
- if (conn->timer == NULL) {
+ if (conn->timer == NULL && conn->frame_timeout) {
timeout.tv_sec = 10;
timeout.tv_usec = 0;
conn->timer = gf_timer_call_after (trans->xl->ctx, timeout,
@@ -440,6 +440,9 @@ client_start_ping (void *data)
conf = this->private;
conn = trans->xl_private;
+ if (!conn->ping_timeout)
+ return;
+
pthread_mutex_lock (&conn->lock);
{
if ((conn->saved_frames->count == 0) ||
@@ -7128,12 +7131,12 @@ struct volume_options options[] = {
},
{ .key = {"frame-timeout"},
.type = GF_OPTION_TYPE_TIME,
- .min = 5,
- .max = 1013,
+ .min = 0,
+ .max = 86400,
},
{ .key = {"ping-timeout"},
.type = GF_OPTION_TYPE_TIME,
- .min = 5,
+ .min = 1,
.max = 1013,
},
{ .key = {NULL} },