From e5f49cc81a976489cb7629cdf1aacf467e9e22a5 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Sat, 23 Jan 2010 17:37:38 +0000 Subject: 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 Signed-off-by: Anand V. Avati 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 --- xlators/protocol/client/src/client-protocol.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'xlators/protocol/client/src/client-protocol.c') diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c index 64c3456a1..91eb6df64 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} }, -- cgit