]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: resolvers: check the SRV expiration date again under the lock
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 29 Sep 2026 07:47:03 +0000 (09:47 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 10 Nov 2026 14:47:52 +0000 (15:47 +0100)
commiteb21fdf114238370e291c8980e762ef670d033b5
treeaef9c8b74e6be54a0ccfea223dd4930fe68603d3
parent8fcd89f2e9734d4f3cceeda5eb8191c5f6ac4a32
BUG/MINOR: resolvers: check the SRV expiration date again under the lock

resolv_srvrq_expire_task() checks that the server's SRV record is expired
before taking the resolvers' lock and cleaning the server up. But the
resolvers' thread may assign an SRV record to this server between the two
(resolv_check_response() resets the task's expiration date under the
lock), in which case the server is then cleaned up and put down right
after being assigned a valid record, until the next SRV response.

This task is only scheduled when a server state file assigns an SRV
target to a server at boot, so the window is very narrow and only exists
once, and this was found by code review.

Let's check the expiration date again once the lock is held.

This patch may be backported to stable branches.
src/resolvers.c