mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
HAProxy - Load balancer
In HTTP keep-alive, if we face a connection error to the server while sending the request, the error should not be reported, and the client-side connection should simply be closed, so that client knows it can retry. If the error happens during the connection stage, there is two cases. We have a connection timeout or an allocation error. In this case, the 503 response must be skipped if it is not the first request on the client-side connection. Or we have a connection error. In this case, the 503 response must be skipped if it is a reused server connection. Otherwise, during the connection stage, the 503-Service-unavailable response is delivered to the client. The part works properly. If the error happens after this stage, the 502-Bad-gateway response delivering should only be based on the server-side connection status. For a reused server connection, the client-side connection must be closed with no reponses. However, for a fresh server-side connection, a 502-Bad-gateway response must be delivered to the client. Unfortunately, This part is buggy. Only the client-side connection state is considered and the response is skipped if it is not the first request for the same client connection. The bug is not so visbile in HTTP/1.1 but in H2 and H3 it is pretty annoying because for a connection, requests are multiplexed, in parallels. It means there is no first request. So, because of this bug, for H2 and H3, 502-Bad-gateway responses because of a connection error before receiveing the response are always skipped. To fix the issue, in http_wait_for_response() analyser, we must only rely on SF_SRV_REUSED stream flag to skip the 502 response or not. This flag is set if the server connection was reused. The bug is their since a while. SF_SRV_REUSED flag was added in the version 1.5 especially to fix this kind of bug. But only the 503 case was fixed. This patch should fix the issue #2285. It must be backported to every stable versions. |
||
|---|---|---|
| .github | ||
| addons | ||
| admin | ||
| dev | ||
| doc | ||
| examples | ||
| include | ||
| reg-tests | ||
| scripts | ||
| src | ||
| tests | ||
| .cirrus.yml | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| .travis.yml | ||
| BRANCHES | ||
| BSDmakefile | ||
| CHANGELOG | ||
| CONTRIBUTING | ||
| INSTALL | ||
| LICENSE | ||
| MAINTAINERS | ||
| Makefile | ||
| README | ||
| SUBVERS | ||
| VERDATE | ||
| VERSION | ||
The HAProxy documentation has been split into a number of different files for ease of use. Please refer to the following files depending on what you're looking for : - INSTALL for instructions on how to build and install HAProxy - BRANCHES to understand the project's life cycle and what version to use - LICENSE for the project's license - CONTRIBUTING for the process to follow to submit contributions The more detailed documentation is located into the doc/ directory : - doc/intro.txt for a quick introduction on HAProxy - doc/configuration.txt for the configuration's reference manual - doc/lua.txt for the Lua's reference manual - doc/SPOE.txt for how to use the SPOE engine - doc/network-namespaces.txt for how to use network namespaces under Linux - doc/management.txt for the management guide - doc/regression-testing.txt for how to use the regression testing suite - doc/peers.txt for the peers protocol reference - doc/coding-style.txt for how to adopt HAProxy's coding style - doc/internals for developer-specific documentation (not all up to date)