On Sunday 06 July 2003 10.52, Henrik Nordstrom wrote:
> Hi,
>
> There obviously is a problem with the close of server-side
> connections, most visible on non-persistent connections. For some
> reason there is a long delay between comm_read detecting the close
> to this being signalled back.

Found it. Was not at all connection related, but a slight design error 
in the io callback queue.

The poll/select loop did not account for the io callback queue, 
causing large delays if events was queued for callback by another 
callback.


   poll -> filedescriptor ready
      read() queued
   queue invoked
      callback queued
   poll -> waiting until timeout
   queue invoked
      callback called


Fixed by adding a comm_iocallbackpending() query to comm_poll/select 
loops, terminating the loop quickly if there is events pending, and 
also by making the main loop invoke the queue twice to deal with 
these indirectly queued events in a more efficient manner. These 
indirect callbacks should be rather frequent in the current design 
with queued I/O operations.

Regards
Henrik

Reply via email to