BUG/MEDIUM: server: support changing the slowstart value from state-file
authorWilly Tarreau <w@1wt.eu>
Thu, 22 Oct 2020 09:30:59 +0000 (11:30 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 3 Nov 2020 14:47:53 +0000 (15:47 +0100)
commit4606476f7be9ed71440f46a5ed0141b0f146c822
treeb802301bd99307220d6e16ae8238d04719e18c11
parent4280ffede752492300c55dd12ff8384b6e9ed379
BUG/MEDIUM: server: support changing the slowstart value from state-file

If the slowstart value in a state file implies the latest state change
is within the slowstart period, we end up calling srv_update_status()
to reschedule the server's state change but its task is not yet
allocated and remains null, causing a crash on startup.

Make sure srv_update_status() supports being called with partially
initialized servers which do not yet have a task. If the task has to
be scheduled, it will necessarily happen after initialization since
it will result from a state change.

This should be backported wherever server-state is present.

(cherry picked from commit 1e690bb6c49590cd3b4fae11c2f85f37e958635e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 550a2f16abb0ef88e75b30c85319a989192de7cd)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/server.c