BUG/MEDIUM: listener: fix pause_listener() suspend return value handling
Legacy suspend() return value handling in pause_listener() has been altered
over the time.
First with fb76bd5ca ("BUG/MEDIUM: listeners: correctly report pause() errors")
Then with e03204c8e ("MEDIUM: listeners: implement protocol level
->suspend/resume() calls")
We aim to restore original function behavior and comply with resume_listener()
function description.
This is required for resume_listener() and pause_listener() to work as a whole
Now, it is made explicit that pause_listener() may stop a listener if the
listener doesn't support the LI_PAUSED state (depending on the protocol
family, ie: ABNS sockets), in this case l->state will be set to LI_ASSIGNED
and this won't be considered as an error.
This could be backported up to 2.4 after a reasonable observation period
to make sure that this change doesn't cause unwanted side-effects.
--
Backport notes:
This commit depends on:
- "MINOR: listener: make sure we don't pause/resume bypassed listeners"
-> 2.4: manual change required because "MINOR: proxy/listener: support
for additional PAUSED state" was not backported: the contextual patch
lines don't match.
Replace this:
| if (px && !px->li_ready) {
| /* PROXY_LOCK is required */
By this:
| if (px && !px->li_ready) {
| ha_warning("Paused %s %s.\n", proxy_cap_str(px->cap), px->id);
(cherry picked from commit 7a15fa58b1087db4af60d4beaca0a11bbc8c0778)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 3c1e3cbe22397120f62bf4ad7db76e8b3adbfae2)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
(cherry picked from commit 82eddf6f2ab7e2b3b75d9181318c0ccf77271734)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit e822967ceb14d2ba14a6ae84c417c9253a813bfd)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed