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

nginx event timer did not work as expected #14

Open
ShenFeng312 opened this issue May 22, 2024 · 2 comments
Open

nginx event timer did not work as expected #14

ShenFeng312 opened this issue May 22, 2024 · 2 comments

Comments

@ShenFeng312
Copy link

No description provided.

@ShenFeng312
Copy link
Author

apache/apisix#10620

@ShenFeng312
Copy link
Author

The bug is caused by differences between OpenResty and Nginx.

In Nginx's ngx_http_upstream.c:

if (!u->request_body_sent) {
        u->request_body_sent = 1;

        if (u->header_sent) {
            return;
        }

        ngx_add_timer(c->read, u->conf->read_timeout);

        if (c->read->ready) {
            ngx_http_upstream_process_header(r, u);
            return;
        }
    }

The added read_timeout is u->conf->read_timeout.

However, in OpenResty, due to the HAVE_NGX_UPSTREAM_TIMEOUT_FIELDS macro, OpenResty directly uses u->read_timeout.

But the ngx_multi_upstream_module does not account for this difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant