]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: proxy: must not try to stop disabled proxies upon reload
authorWilly Tarreau <w@1wt.eu>
Wed, 3 Oct 2012 22:14:33 +0000 (00:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 3 Oct 2012 22:20:55 +0000 (00:20 +0200)
HervĂ© Commowick reported an issue : haproxy dies in a segfault during a
soft restart if it tries to pause a disabled proxy. This is because disabled
proxies have no management task so we must not wake the task up. This could
easily remain unnoticed since the old process was expected to go away, so
having it go away faster was not really troubling. However, with sync peers,
it is obvious that there is no peer sync during this reload.

This issue has been introduced in 1.5-dev7 with the removal of the
maintain_proxies() function. No backport is needed.

include/types/proxy.h
src/proxy.c

index 5c078d9e492f642b1d9a6d4d21ee813a28af0aab..641bc1c7ba742e70bb7b6a21b0030850d397857a 100644 (file)
@@ -325,7 +325,7 @@ struct proxy {
        struct list listener_queue;             /* list of the temporarily limited listeners because of lack of a proxy resource */
        struct stktable table;                  /* table for storing sticking sessions */
 
-       struct task *task;                      /* the associated task, mandatory to manage rate limiting, stopping and resource shortage */
+       struct task *task;                      /* the associated task, mandatory to manage rate limiting, stopping and resource shortage, NULL if disabled */
        int grace;                              /* grace time after stop request */
        char *check_req;                        /* HTTP or SSL request to use for PR_O_HTTP_CHK|PR_O_SSL3_CHK */
        int check_len;                          /* Length of the HTTP or SSL3 request */
index 8db70b60126e9357df67ab75e5d39af6b325bad2..820be2fa5ca9e68dc88a17d2c42b2f3527394312 100644 (file)
@@ -609,7 +609,8 @@ void soft_stop(void)
                         task_wakeup(p->table.sync_task, TASK_WOKEN_MSG);
 
                /* wake every proxy task up so that they can handle the stopping */
-               task_wakeup(p->task, TASK_WOKEN_MSG);
+               if (p->task)
+                       task_wakeup(p->task, TASK_WOKEN_MSG);
                p = p->next;
        }