git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: David Turner <dturner@twopensource.com>
Cc: "Torsten Bögershausen" <tboegi@web.de>,
	"Lars Schneider" <larsxschneider@gmail.com>,
	"Git List" <git@vger.kernel.org>,
	pclouds@gmail.com
Subject: Re: [BUG] t7063-status-untracked-cache flaky?
Date: Fri, 16 Oct 2015 13:34:33 -0700	[thread overview]
Message-ID: <xmqqfv1aeena.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1445026298.20887.28.camel@twopensource.com> (David Turner's message of "Fri, 16 Oct 2015 16:11:38 -0400")

David Turner <dturner@twopensource.com> writes:

> The problem is:
>
> trash directory.t7063-status-untracked-cache$ diff trace trace.expect 
> 3,4c3,4
> < directory invalidation: 1
> < opendir: 1
> ---
>> directory invalidation: 2
>> opendir: 2
>
>
> I can repro on a SSD.
>
> I had to try many times to reproduce (I think even more the second
> time). I just ran the test in a while loop until it failed.
>
> I suspect that the kernel might be a bit slow to update the mtime on the
> directory, but I have not yet been able to repro, and I don't understand
> why it only happens in this one test, since sparseness should be
> completely unrelated.

If you are invalidating your cache based on mtime of the directory,
an operation within mtime granularity can cause you to miss it,
unless you try to be conservative and do the "assume invalid if
racy".  And if you do "assume invalid if racy", the result will
become timing dependent.  You may end up invalidating more than
absolutely necessary, i.e. the test writer may have known that at
least 1 must be definitely stale at that point in the test, but
if another directory was iffy and the code played safe, you would
see one more invalidation than expected (which would lead to
scanning the directory, hence one more opendir).

Is that what is going on here?

  reply	other threads:[~2015-10-16 20:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15  7:52 [BUG] t7063-status-untracked-cache flaky? Lars Schneider
2015-10-15 19:44 ` David Turner
2015-10-16 15:22 ` Torsten Bögershausen
2015-10-16 20:11   ` David Turner
2015-10-16 20:34     ` Junio C Hamano [this message]
2015-10-16 21:25       ` David Turner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqfv1aeena.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=dturner@twopensource.com \
    --cc=git@vger.kernel.org \
    --cc=larsxschneider@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).