[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Re: Cancelling Subversion operations

From: Bill Tutt <rassilon_at_lyra.org>
Date: 2002-09-18 17:24:57 CEST

> From: Philip Martin [mailto:philip@codematters.co.uk]
> "Bill Tutt" <rassilon@lyra.org> writes:
> > > Which cancellation editor? Is there some mechanism already in
> > > Grepping the source code for "cancel" doesn't reveal anything.
> >
> > Once upon a time, (dunno if the code is still there), I had
submitted a
> > patch for a cancellation editor that got composed with the update
> > commit editors. This allowed per operation cancellation baton state
> > be used and leveraged.
> I don't see anything obvious in the current code. I have found some
> patches in the mailing list from about nine months ago, a combined
> trace/cancel set, I guess they never made it into the code base.

That wouldn't surprise me. :(

> > > > Doing it this way lets the user application maintain its state
> however
> > > > it wants, and not in some bizarre way that's necessitated by
> > > > Subversion's API choice.
> > > >
> > > > It just so happens that the command line client doesn't care so
> > > > but other more sophisticated users of the API might.
> > >
> > > It also happens to be fairly simple to implement. I'm not sure
how a
> > > general cancellation mechanism would work, but I suspect it may
> > > involve passing some sort of context baton through every
> > > function. That may not be a bad thing to do anyway; I'm wondering
> > > it would be a better approach to the access baton stuff.
> From a quick browse through the patches it seems that it would allow
> the application to cancel at each editor function. That does not
> introduce as many cancellation points as Garrett's patch, but it may
> be enough.

The cancellation editor idea was to try and provide a tradeoff between
always calling the cancellation callback everywhere, and trying to
ensure that the cancellation callback got called before every possibly
expensive network touching operation. (i.e. mostly trying to ensure that
a multi-threaded UI could have a chance in cancellation the current
operation in progress)

> A few places would not allow cancellation, post-commit
> processing for example, I don't know if that's a problem. I suppose
> it depends on exactly how many operations fit into the cancellation
> editor scheme: what about transmitting postfix text deltas during a
> commit, or receiving a large file during an update?

If you're canceling a commit, then we don't care where the cancellation
happens. Post-commit processing should be asynchronous anyway. The user
application shouldn't be able to cancel post-commit processing except
from within the post-commit processing code.

> > > What sort of thing do you see a sophisticated API user doing when
> > > repsonds to an asynchronous signal?
> >
> > The user API might have multiple Subversion operation contexts
> > the GUI is multi-threaded. One thread for user directed requests,
> > another for background communication requests to lazily update the
> > every so often.
> >
> > The UI might very well want to have different cancellation baton
> > for each UI context.
> Well, the approach in Garrett's patch does allow an application to
> cancel on the basis of thread identity, and if the application tracks
> which operation each thread is running it can decide which threads to
> cancel.

At the cost of a bunch of synchronizing objects for each call into the
cancellation object. Ick...

> The cancellation editor approach fits in neatly with the other editor
> code. I wonder how much bit-rot your patches have suffered over the
> months? I think the trace part is redundant, but the cancel part may
> be worth investigating.

Got me. I don't really care about the cancellation editor continuing to
exist as I wrote it originally. I just want Subversion's public API to
support the ability of the user application to supply multiple
cancellation batons.

If you use an updated version of the patch, great, if not I don't care.
Just give our API users the ability to pass in multiple cancellation


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 18 17:25:38 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.