]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: stream: fix session leak on applet-initiated connections
authorWilly Tarreau <w@1wt.eu>
Wed, 29 Nov 2017 13:05:38 +0000 (14:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 29 Nov 2017 13:26:11 +0000 (14:26 +0100)
commit5bcfd56519b683386643c800558714893fd33910
tree164e594957066bdd5981a03317d7ba73a61b93fb
parentec7464726f90a8c9536c21a693631a1193f81e19
BUG/MEDIUM: stream: fix session leak on applet-initiated connections

Commit 3e13cba ("MEDIUM: session: make use of the connection's destroy
callback") ensured that connections could be autonomous to destroy the
session they initiated, but it didn't take care of doing the same for
applets. Such applets are used for peers, Lua and SPOE outgoing
connections. In this case, once the stream ends, it closes everything
and nothing takes care of releasing the session. The problem is not
immediately obvious since the only visible effect is that older
processes will not quit on reload after having leaked one such session.

For now we check in stream_free() if the session's origin is the applet
we're releasing, and then free the session as well. Something more
uniform should probably be done once we manage to unify applets and
connections a bit more.

This fix needs to be backported to 1.8. Thanks to Emmanuel Hocdet for
reporting the problem.
src/stream.c