mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
[MEDIUM] don't report buffer timeout when there is I/O activity
We don't want to report a buffer timeout if there was I/O activity for the same events. That way we'll not have to always re-arm timeouts on I/O, without the fear of a timeout triggering too fast.
This commit is contained in:
parent
f890dc9003
commit
dd80c6f92d
@ -67,14 +67,17 @@ static inline int buffer_isfull(const struct buffer *buf) {
|
|||||||
|
|
||||||
/* Check buffer timeouts, and set the corresponding flags. The
|
/* Check buffer timeouts, and set the corresponding flags. The
|
||||||
* likely/unlikely have been optimized for fastest normal path.
|
* likely/unlikely have been optimized for fastest normal path.
|
||||||
|
* The read/write timeouts are not set if there was activity on the buffer.
|
||||||
|
* That way, we don't have to update the timeout on every I/O. Note that the
|
||||||
|
* analyser timeout is always checked.
|
||||||
*/
|
*/
|
||||||
static inline void buffer_check_timeouts(struct buffer *b)
|
static inline void buffer_check_timeouts(struct buffer *b)
|
||||||
{
|
{
|
||||||
if (likely(!(b->flags & (BF_SHUTR|BF_READ_TIMEOUT))) &&
|
if (likely(!(b->flags & (BF_SHUTR|BF_READ_TIMEOUT|BF_READ_ACTIVITY))) &&
|
||||||
unlikely(tick_is_expired(b->rex, now_ms)))
|
unlikely(tick_is_expired(b->rex, now_ms)))
|
||||||
b->flags |= BF_READ_TIMEOUT;
|
b->flags |= BF_READ_TIMEOUT;
|
||||||
|
|
||||||
if (likely(!(b->flags & (BF_SHUTW|BF_WRITE_TIMEOUT))) &&
|
if (likely(!(b->flags & (BF_SHUTW|BF_WRITE_TIMEOUT|BF_WRITE_ACTIVITY))) &&
|
||||||
unlikely(tick_is_expired(b->wex, now_ms)))
|
unlikely(tick_is_expired(b->wex, now_ms)))
|
||||||
b->flags |= BF_WRITE_TIMEOUT;
|
b->flags |= BF_WRITE_TIMEOUT;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user