Hyrum,
On IRC, we also talked about trying to remove stat() calls from the
parse function. Upon reflection, that won't be possible. If the given
path is below a wcroot, then we cannot simply return that wcroot. We
need to see if the path is in a CHILD wcroot (think: nested wcroots in
a disjoint working copy). Thus, we need to examine the disk to look
for the closest wcroot to a given path.
If we continue to keep a mapping of dirpath->wcroot, then we can avoid
future stat calls after the first (effectively, it is a cache). For a
file, we will always need a stat since the fname will not be in a
memory structure. When the file is discovered, the parent directory
may be in the cache and no further stats will be required.
The loop at the end of the parse function will still be desirable to
cache dirpath:wcroot mappings from the target path up to the actual
wcroot.
Cheers,
-g
On Fri, Feb 25, 2011 at 02:54, Greg Stein <gstein_at_gmail.com> wrote:
> Hyrum,
>
> I #if'd out the child/parent section at the end of parse_local_abspath
> that we talked about on IRC, and confirmed the test failures that you
> saw. Digging in, it turns out that we end up calling "owns lock" with
> two different wcroot_t structures. IOW, the wcroot that opened/owns
> the lock is attached to one directory, but another directory ends up
> with its own wcroot_t which has no "owned" locks associated with it,
> so things blow up because the code believes some other process is
> working on that other directory.
>
> With the old PDH code in there, we get the wcroot inserted into PDH
> structures all the way up to the root. Any lookup thereafter will
> share the same wcroot_t structure.
>
> As we discussed on IRC, if a move is made to a more pure lookup of
> wcroot_t ancestors, then it could solve this particular problem.
>
> Your conversion of dir_data to wcroot pointers may run into a similar
> problem. I don't know enough about your change to truly know, but be
> aware of the problem. An SVN_DBG in create_wcroot could provide a lot
> of information (generally, it should only ever be called once per
> process).
>
> I'm putting this on hold now because I don't want to interfere with
> your work. A suggested fix would be to switch wcroot_parse to a new
> algorithm that cleans out the PDH concept and more directly identifies
> (and reuses!) a parent wcroot. I'd be happy to coordinate that rewrite
> with/for you.
>
> Cheers,
> -g
>
Received on 2011-02-27 08:35:22 CET