Re: comm_write(), write cancellations, etc

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Sun, 24 Aug 2008 22:15:01 -0600

On Sat, 2008-08-23 at 08:31 +0800, Adrian Chadd wrote:
> I'm also probably going to go for
> "will always complete" versus the current cancellation models in
> Squid-3. Ie, a cancelled IO transaction will still call the completion
> callback with some kind of "error/cancelled" status; the callback
> function can then cleanup as appropriate.

I doubt it is a good idea to try to force every job ordering the I/O to
wait for the I/O completion call. If the job has to terminate for some
reason, it should cancel its Comm call(s) and focus on the termination
business.

Allowing the job to cancel its interest in I/O does not complicate the
Comm code (that does not care what the job does with the call). It does
simplify the job code (that does not have to "idle" while waiting for a
Comm call it no longer cares about).

What often needs a cleanup is job code that uses comm_close() to
indirectly trigger that job cleanup and destruction. In most cases,
there are better ways to clean and terminate the job than relying on
Comm to eventually initiate that process even though the termination
reason had nothing to do with the pending Comm I/Os.

HTH,

Alex.
Received on Mon Aug 25 2008 - 04:16:13 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 25 2008 - 12:00:08 MDT