mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
BUG/MEDIUM: trace: avoid race condition when retrieving session from conn->owner
There's a rare race condition possible when trying to retrieve session from a back connection's owner, that was fixed in 2.4 and described in commit 3aab17bd5 ("BUG/MAJOR: connection: reset conn->owner when detaching from session list"). It also affects the trace code which does the same, so the same fix is needed, i.e. check from conn->session_list that the connection is still enlisted. It's visible when sending a few tens to hundreds of parallel requests to an h2 backend and enabling traces in parallel. This should be backported as far as 2.2 which is the oldest version supporting traces.
This commit is contained in:
parent
d1480cc8a4
commit
6e805dab2a
@ -122,7 +122,7 @@ void __trace(enum trace_level level, uint64_t mask, struct trace_source *src,
|
|||||||
|
|
||||||
if (!sess && strm)
|
if (!sess && strm)
|
||||||
sess = strm->sess;
|
sess = strm->sess;
|
||||||
else if (!sess && conn)
|
else if (!sess && conn && LIST_INLIST(&conn->session_list))
|
||||||
sess = conn->owner;
|
sess = conn->owner;
|
||||||
else if (!sess && check)
|
else if (!sess && check)
|
||||||
sess = check->sess;
|
sess = check->sess;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user