Re: async-calls squid3/src comm.cc,1.81.4.16,1.81.4.17

From: Henrik Nordström <henrik@dont-contact.us>
Date: Mon, 07 Jan 2008 00:51:44 +0100

sön 2008-01-06 klockan 12:27 +0200 skrev Tsantilas Christos:
> Hi Henrik,
> It is not a cbdata problem.

Are you sure?

cbdata exists to help invalidate callbacks when they are no longer
meaningful. A callback being made to something no longer meaningful is a
clear sign of a missing cbdata barrier..

> An example is in the HttpStateData::sendComplete method which is going
> to execute an commSetTimeout(fd ...)

The FD related state should no longer exist if the FD has been closed.
That's what cbdata deals with.

> Also I had a similar problem in tunnel.cc with the tunnelClientClosed
> and tunnelServerClosed comm_close handlers, where the comm_close handler
> of server closes the client socket and opposite.

Yes, that state object is a bit difficult as it manages both, and need
to be extra careful.

> With this patch squid now starts closing the fd , it mark it as
> "closing" but actually schedules the real fd closing to a future, after
> the comm_close handlers will be really executed.

And why is this needed? The sendComplete callback should be invalidated
if the HTTP connection state is no longer there.

Adding this reshedule adds a noticeable overhead an delay, plus makes
tracing of the code flow more difficult.

Regards
Henrik
Received on Sun Jan 06 2008 - 16:53:48 MST

This archive was generated by hypermail pre-2.1.9 : Wed Jan 30 2008 - 12:00:09 MST