Help with AIO

Igor Sysoev igor at sysoev.ru
Fri Sep 16 10:39:07 UTC 2011


On Thu, Sep 15, 2011 at 04:21:44PM +0200, Hagai Avrahami wrote:
> Hi
> 
> When benchmarking AIO read, I reached more than 1024 concurrent Async IO -
> 1. I saw a weird error log
> 2. Nginx did not fallback to regular blocking read
> 
> I looked on the source code --  src/os/unix/ngx_linux_aio_read.c  line:105
> and I think  there is a problem in errno handling
> 
> // Current Code
> //----------------------------------------------------------------------------
>     *n = io_submit(ngx_aio_ctx, 1, piocb);
> 
>     if (n == 1) {
>         ev->active = 1;
>         ev->ready = 0;
>         ev->complete = 0;
> 
>         return NGX_AGAIN;
>     }
> 
>     n = -n;    <---------------------------------------------------------??

Thank you, this is a bug. I confused this with _syscall(2).


-- 
Igor Sysoev



More information about the nginx mailing list