]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: stream-interface: don't wake the task up before end of transfer
authorWilly Tarreau <w@1wt.eu>
Sat, 25 Jan 2014 01:33:21 +0000 (02:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 25 Jan 2014 21:28:22 +0000 (22:28 +0100)
commite6300be8f807858d146d23b4eabb9934b96873ee
tree94e37a320c78bc748fbbf592f7074ffffbbbeadd
parent4afd70aeaba5ca2952e60f978701c7f98dc438ae
BUG/MEDIUM: stream-interface: don't wake the task up before end of transfer

Recent commit d7ad9f5 ("MAJOR: channel: add a new flag CF_WAKE_WRITE to
notify the task of writes") was not correct. It used to wake up the task
as soon as there was some write activity and the flag was set, even if there
were still some data to be forwarded. This resulted in process_session()
being called a lot when transfering chunk-encoded HTTP responses made of
very large chunks.

The purpose of the flag is to wake up only a task waiting for some
room and not the other ones, so it's totally counter-productive to
wake it up as long as there are data to forward because the task
will not be allowed to write anyway.

Also, the commit above was taking some risks by not considering
certain events anymore (eg: state != SI_ST_EST). While such events
are not used at the moment, if some new features were developped
in the future relying on these, it would be better that they could
be notified when subscribing to the WAKE_WRITE event, so let's
restore the condition.
src/stream_interface.c