]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: spoe: Remove useless 'timeout ack' option
authorChristopher Faulet <cfaulet@haproxy.com>
Sat, 19 Nov 2016 15:47:56 +0000 (16:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 21 Nov 2016 14:29:59 +0000 (15:29 +0100)
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
doc/SPOE.txt
src/flt_spoe.c

index 3494256c4aff97a7270df64c90a392585dbe1f5e..7e376ee1d6b856f6b70f8ba0968a548e1fcba770 100644 (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
 
index f9aac7108ea814c76d899c488b32fd6f1bc56da4..1ad4f3792f5b674d05933fd8d5b424719aea35a4 100644 (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
 
index b3f2ef3a370032243df889ebe488e5323357c809..4361773381c2c7e0f9d41fb616c3675d7c7778fb 100644 (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) {