mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-26 07:22:49 +00:00
BUG/MAJOR: always clear the CO_FL_WAIT_* flags after updating polling flags
The CO_FL_WAIT_* flags were not cleared after updating polling flags. This means that any caller of these functions that did not clear it would enable polling instead of speculative I/O. This happens during the stream interface update call which is performed from the session handler for example. As of now it's not a problem yet because speculative I/O and polling are handled the same way. However with upcoming changes it does cause some deadlocks because enabling read processing on a file descriptor where everything was already read will do nothing until something new happens on this FD. The correct fix consists in clearing the flags while leaving the update functions. This fix does not need any backport as it was introduced with recent connection changes (dev12) and not triggered until last commit.
This commit is contained in:
parent
c8dd77fddf
commit
c9f7804aad
@ -201,7 +201,7 @@ void conn_update_data_polling(struct connection *c)
|
||||
fd_stop_send(c->t.sock.fd);
|
||||
f &= ~CO_FL_CURR_WR_ENA;
|
||||
}
|
||||
c->flags = f;
|
||||
c->flags = f & ~(CO_FL_WAIT_RD | CO_FL_WAIT_WR);
|
||||
}
|
||||
|
||||
/* Update polling on connection <c>'s file descriptor depending on its current
|
||||
@ -249,7 +249,7 @@ void conn_update_sock_polling(struct connection *c)
|
||||
fd_stop_send(c->t.sock.fd);
|
||||
f &= ~CO_FL_CURR_WR_ENA;
|
||||
}
|
||||
c->flags = f;
|
||||
c->flags = f & ~(CO_FL_WAIT_RD | CO_FL_WAIT_WR);
|
||||
}
|
||||
|
||||
/* This handshake handler waits a PROXY protocol header at the beginning of the
|
||||
|
Loading…
Reference in New Issue
Block a user