]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[BUG] stream_sock: check for shut{r,w} before refreshing some timeouts
authorWilly Tarreau <w@1wt.eu>
Sun, 29 Mar 2009 08:18:41 +0000 (10:18 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 29 Mar 2009 08:18:41 +0000 (10:18 +0200)
commitd06e71179a5f7e42a65fab45748ef0fa4b1850ce
treea3d243285f99b35e4b5fe61db059f5d59631792d
parentc6dcad6e743dcdbf1b1c31ee4ba0b860119385ff
[BUG] stream_sock: check for shut{r,w} before refreshing some timeouts

Under some circumstances, it appears possible to refresh a timeout
just after a side has been shut. For instance, if poll() plans to
call both read and write, and the read side calls chk_snd() which
in turn causes a shutw to occur, then stream_sock_write could update
its write timeout. The same problem happens the other way.

The timeout checks will then not catch these cases because they
ignore timeouts in case of shut{r,w}.

This is very likely to be the major cause of the 100% CPU usages
reported by Bart Bobrowski.

The fix consists in always ensuring that a side is not shut before
updating its timeout.
src/stream_sock.c