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.
This commit is contained in:
Christopher Faulet 2016-11-19 16:47:56 +01:00 committed by Willy Tarreau
parent f7a3092512
commit 03a3449e1a
3 changed files with 11 additions and 30 deletions

View File

@ -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

View File

@ -158,7 +158,7 @@ spoe-agent <name>
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 <prefix>
for existing ones.
timeout ack <timeout>
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 :
<timeout> 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 <timeout>
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

View File

@ -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) {