Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server_forward_retries directive is ignored if request is forwarded to inactive server connection #1003

Closed
vankoven opened this issue Apr 6, 2018 · 0 comments
Assignees
Labels

Comments

@vankoven
Copy link
Contributor

vankoven commented Apr 6, 2018

When a request is sent to backend in tfw_http_req_fwd_send(), an error may happen in ss_send(), e.g. socket is inactive. In this case the request is dropped and 500 error is returned to client:

tempesta/tempesta_fw/http.c

Lines 1103 to 1104 in 036a0f1

tfw_http_req_err(srv_conn, req, eq, 500,
"request dropped: forwarding error");

You can see warnings in the system log:

[ 6627.198664] [tempesta] Warning: request dropped: forwarding error, status 500: ::ffff:c0a8:7a01
[ 6641.007429] [tempesta] Warning: request dropped: forwarding error, status 500: ::ffff:c0a8:7a01
[ 6645.200972] [tempesta] Warning: request dropped: forwarding error, status 500: ::ffff:c0a8:7a01
[ 6668.633026] [tempesta] Warning: request dropped: forwarding error, status 500: ::ffff:c0a8:7a01
[ 6674.709124] [tempesta] Warning: request dropped: forwarding error, status 500: ::ffff:c0a8:7a01
[ 6676.332363] [tempesta] Warning: request dropped: forwarding error, status 500: ::ffff:c0a8:7a01

The tfw_http_req_fwd_send() function doesn't honour server_forward_retries directive and drops the request on very first ss_send() failure. Instead Tempesta must increment message retry count on failure and drop request only in tfw_http_req_evict_retries() function.

unsigned short retries;

@vankoven vankoven self-assigned this Apr 6, 2018
@vankoven vankoven added this to the 0.6 KTLS milestone Apr 6, 2018
aleksostapenko added a commit that referenced this issue Dec 20, 2018
krizhanovsky pushed a commit that referenced this issue Jan 26, 2019
krizhanovsky pushed a commit that referenced this issue Jan 26, 2019
aleksostapenko added a commit that referenced this issue Feb 19, 2019
Fix #1003: Store requests for resending if connection became inactive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants