From 03a3449e1a9b9253e335adbf11b1b80561d43255 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Sat, 19 Nov 2016 16:47:56 +0100 Subject: [PATCH] MINOR: spoe: Remove useless 'timeout ack' option To limit the time to process an event, you should set 'timeout processing' option. So 'timeout ack' option is redundant and useless. --- contrib/spoa_example/README | 6 +++--- doc/SPOE.txt | 19 ++++--------------- src/flt_spoe.c | 16 ++++------------ 3 files changed, 11 insertions(+), 30 deletions(-) diff --git a/contrib/spoa_example/README b/contrib/spoa_example/README index 3494256c4..7e376ee1d 100644 --- a/contrib/spoa_example/README +++ b/contrib/spoa_example/README @@ -36,9 +36,9 @@ the configuration template to use for your SPOE: option var-prefix iprep - timeout hello 1s - timeout ack 10ms - timeout idle 30s + timeout hello 100ms + timeout idle 30s + timeout processing 15ms use-backend iprep-backend diff --git a/doc/SPOE.txt b/doc/SPOE.txt index f9aac7108..1ad4f3792 100644 --- a/doc/SPOE.txt +++ b/doc/SPOE.txt @@ -158,7 +158,7 @@ spoe-agent following keywords are supported : - messages - option var-prefix - - timeout hello|idle|ack|processing + - timeout hello|idle|processing - use-backend @@ -198,17 +198,6 @@ option var-prefix for existing ones. -timeout ack - Set the maximum time to wait for an agent to receive the acknowledgement to a - NOTIFY frame. It is applied on the stream that handle the connection with the - agent. - - Arguments : - is the timeout value specified in milliseconds by default, but - can be in any other unit if the number is suffixed by the unit, - as explained at the top of this document. - - timeout hello Set the maximum time to wait for an agent to receive the AGENT-HELLO frame. It is applied on the stream that handle the connection with the agent. @@ -350,9 +339,9 @@ and 0 a blacklisted IP with no doubt). option var-prefix iprep - timeout hello 2s - timeout ack 10ms - timeout idle 2m + timeout hello 2s + timeout idle 2m + timeout processing 10ms use-backend iprep-servers diff --git a/src/flt_spoe.c b/src/flt_spoe.c index b3f2ef3a3..436177338 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -192,7 +192,6 @@ struct spoe_agent { struct { unsigned int hello; /* Max time to receive AGENT-HELLO frame (in SPOE applet) */ unsigned int idle; /* Max Idle timeout (in SPOE applet) */ - unsigned int ack; /* Max time to acknowledge a NOTIFY frame (in SPOE applet)*/ unsigned int processing; /* Max time to process an event (in the main stream) */ } timeout; @@ -1431,7 +1430,7 @@ handle_spoe_applet(struct appctx *appctx) else if (!ret) goto full; ctx->state = SPOE_CTX_ST_WAITING_ACK; - APPCTX_SPOE(appctx).task->expire = tick_add_ifset(now_ms, agent->timeout.ack); + APPCTX_SPOE(appctx).task->expire = tick_add_ifset(now_ms, agent->timeout.idle); } skip_notify_frame: @@ -1495,7 +1494,7 @@ handle_spoe_applet(struct appctx *appctx) __FUNCTION__, appctx, spoe_status_code, spoe_frm_err_reasons[spoe_status_code]); - APPCTX_SPOE(appctx).task->expire = tick_add_ifset(now_ms, agent->timeout.ack); + APPCTX_SPOE(appctx).task->expire = tick_add_ifset(now_ms, agent->timeout.idle); appctx->st0 = SPOE_APPCTX_ST_DISCONNECTING; /* fall through */ @@ -2627,7 +2626,6 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm) curagent->conf.file = strdup(file); curagent->conf.line = linenum; curagent->timeout.hello = TICK_ETERNITY; - curagent->timeout.ack = TICK_ETERNITY; curagent->timeout.idle = TICK_ETERNITY; curagent->timeout.processing = TICK_ETERNITY; curagent->var_pfx = NULL; @@ -2693,12 +2691,10 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm) tv = &curagent->timeout.hello; else if (!strcmp(args[1], "idle")) tv = &curagent->timeout.idle; - else if (!strcmp(args[1], "ack")) - tv = &curagent->timeout.ack; else if (!strcmp(args[1], "processing")) tv = &curagent->timeout.processing; else { - Alert("parsing [%s:%d] : 'timeout' supports 'connect', 'idle', 'ack' or 'processing' (got %s).\n", + Alert("parsing [%s:%d] : 'timeout' supports 'connect', 'idle' or 'processing' (got %s).\n", file, linenum, args[1]); err_code |= ERR_ALERT | ERR_FATAL; goto out; @@ -3001,15 +2997,11 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px, } if (curagent->timeout.hello == TICK_ETERNITY || curagent->timeout.idle == TICK_ETERNITY || - curagent->timeout.ack == TICK_ETERNITY || curagent->timeout.processing == TICK_ETERNITY) { - if (curagent->timeout.ack == TICK_ETERNITY) - curagent->timeout.ack = curagent->timeout.idle; - Warning("Proxy '%s': missing timeouts for SPOE agent '%s' declare at %s:%d.\n" " | While not properly invalid, you will certainly encounter various problems\n" " | with such a configuration. To fix this, please ensure that all following\n" - " | timeouts are set to a non-zero value: 'hello', 'idle', 'ack', 'processing'.\n", + " | timeouts are set to a non-zero value: 'hello', 'idle', 'processing'.\n", px->id, curagent->id, curagent->conf.file, curagent->conf.line); } if (curagent->var_pfx == NULL) {