ShenFeng312 commented on issue #10620:
URL: https://github.com/apache/apisix/issues/10620#issuecomment-2109221470

   
   When reading data from upstream, APISIX invokes 
`ngx_http_multi_upstream_handler`, which then proceeds to 
`ngx_http_multi_upstream_process` and ultimately to 
`ngx_http_multi_upstream_read_handler`.
   
   In `ngx_http_multi_upstream_read_handler`, a timeout event is added:
   
   ```c
   n = c->recv(c, b->last, b->end - b->last);
   
   if (n == NGX_AGAIN) {
       ngx_add_timer(pc->read, u->conf->read_timeout);
   }
   ```
   The purpose of this code is to handle read timeouts. However, I cannot 
understand why `ngx_http_multi_upstream_handler` is triggered immediately after 
each `ngx_add_timer` call.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to