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

Re: svn_delta_path_driver(), its purpose and future

From: Hyrum K Wright <hyrum.wright_at_wandisco.com>
Date: Tue, 29 Nov 2011 23:59:14 -0600

On Tue, Nov 29, 2011 at 4:20 PM, C. Michael Pilato <cmpilato_at_collab.net> wrote:
> On 11/29/2011 04:56 PM, Hyrum K Wright wrote:
>> I understand and expect that consumers of SDPD as currently
>> implemented will need to use Ev1.  The problem is that they don't take
>> very kindly to instances where Ev1 is driven in an asynchronous mode,
>> which doesn't technically violate the Ev1 API.  But I think this is a
>> problem that we can work around.
>
> But ... but ... the code sites which are using SDPD *are* the drivers of the
> editor, not the implementors.
>
> Maybe you meant, "they don't take very kindly to instances where Ev1 doesn't
> immediately return an error because all the real work is done by a nested
> Ev2 in a big batch at the end of the Ev1 drive" ?

Let me offer a concrete example, in the hopes that I can make some
sense. I use the term "sender" to mean "the thing that is invoking
the editor callbacks" and "receiver" to mean "the thing who is
providing callbacks to be invoked". I believe these are the
traditional uses of the terms; if not, I've got some more reeducation
to go through.

In libsvn_client/mergeinfo.c there is a function named
svn_client__elide_mergeinfo_catalog() (or SCEMC for short). SCEMC
uses SDPD to elider mergeinfo and uses a default Ev1 editor with only
custom open_root() and open_directory() handlers[1]. It provides this
editor to SDPD.

Without the shims, everything works well, but when the delayed-run
action of the shims is inserted, we get crashes. The reason for this
is that with the shims, the SDPD callback is invoked prior to any
open_directory() handlers of the editor are invoked, and the SDPD
callback depends upon state which the open_directory() handler sets.

Basically, the delayed processing of the Ev1 open_directory() handler
is combined with the *immediate* handling of the SDPD callback, which
results in out-of-order execution of the SDPD callback, and from there
badness ensues. My thought is to move the shim insertion inside SDPD
and make it clever enough to delay calling the SDPD callback until the
Ev1 queue is played back, thus ensuring the ordering is then correct.

-Hyrum

[1] In this case at least, the code site where SDPD is used *is* the
implementor of the editor, not the driver. SCEMC provides an editor
to SDPD which it then drives.

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Received on 2011-11-30 06:59:56 CET

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.