[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[users@httpd] Re: Non Blocking write in apache

Hi All,

Actually it is setting sock->timeout to 0 in writev_nonblocking() in core_filters.c. 
arv = apr_socket_timeout_set(s, 0);

Why does the default timeout  is changed and set to 0 ??

On Wed, Sep 12, 2018 at 4:03 PM Hemant Chaudhary <hemantdude.chaudhary@xxxxxxxxx> wrote:
Hi All,

I am using proxy_http to proxy my request to tomcat from apache. But in non-blocking call it is not working properly(timeout issue). I am using the default timeout i:e 60 sec. 

When writev returns -1 with errorno==4101, it should wait and then again try for write. 
while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK) 
                      && (sock->timeout > 0)) _____ code snippet from sendrecv.c

In debugging I have checked that sock->timeout is equal to 0. Therefore this condition is failed and request failed.

When default timeout is 60sec then why does sock->timeout becomes 0 ??

On further debugging, I came to know the reqtimeout_eor function is setting timeout to 0.

static apr_status_t reqtimeout_eor(ap_filter_t *f, apr_bucket_brigade *bb)
        reqtimeout_con_cfg *ccfg = f->ctx;
        ccfg->timeout_at = 0;
    return ap_pass_brigade(f->next, bb);

I am not able to understand why this function is setting to 0. 

Can somebody help me to understand the issue ?