Re: cvs commit: squid3/src EventLoop.cc

From: Alex Rousskov <rousskov@dont-contact.us>
Date: Mon, 23 Jul 2007 17:01:44 -0600

On Tue, 2007-07-24 at 00:18 +0200, Henrik Nordstrom wrote:
> On mån, 2007-07-23 at 13:55 -0600, Alex Rousskov wrote:
>
> > Reversed bug #2011 fix because it may slow down ICAP, BodyPipe, and other code
> > using zero-delay events to implement "asynchronous" calls.
>
> Can you elaborate a little on this?
>
> If the event is zero-delay it should be picked up immediately,

but sometimes it is not.

> at least unless you are doing a chain of zero-delay events without using an
> "primary" event.
  
I may be doing that, but I do not know what a "primary" event is.

BodyPipe and ICAP code may schedule several zero-delay events in a row.
In fact, they do that often. If that is not supported, I would have to
add such support because rewriting the code to avoid such "chains" seems
both difficult and "wrong".

> > The code should probably be rewritten (a) to avoid any waiting/blocking when
> > there are ready events and (b) to allow waiting longer when there are no ready
> > events.
>
> Hmm.. in Squid-2 the loop delay is automatically adjusted to account for
> timer events. Think the same should be done in Squid-3, and to have
> other kinds of events feed a notification to the main event engine.

As far as I can tell, Squid3 code also tries to adjust the delay, but it
does it without taking events in the dispatcher queue into account. The
fact that increasing default timeout to 1 second caused problems is a
proof of that.

We can and should fix all that, but hopefully we can leave with 10msec
default for now. A proper/complete fix may not be trivial.

Alex.
Received on Mon Jul 23 2007 - 17:02:12 MDT

This archive was generated by hypermail pre-2.1.9 : Wed Aug 01 2007 - 12:00:06 MDT