Patchwork [evolve-ext] evolve: fixing obscache invalidation

login
register
mail settings
Submitter via Mercurial-devel
Date May 17, 2017, 6:38 a.m.
Message ID <8a19c6e8a1125be6bf6a.1495003105@rdamazio.svl.corp.google.com>
Download mbox | patch
Permalink /patch/20651/
State Accepted
Headers show

Comments

via Mercurial-devel - May 17, 2017, 6:38 a.m.
# HG changeset patch
# User Rodrigo Damazio Bovendorp <rdamazio@google.com>
# Date 1495003030 25200
#      Tue May 16 23:37:10 2017 -0700
# Node ID 8a19c6e8a1125be6bf6a5c97dc345c37c39a1189
# Parent  2241433a77e543ee068039fa2fb9ad514decca93
evolve: fixing obscache invalidation

This was missing a call to the parent's destroyed(), such that any transaction
after stripping some nodes would result in a crash (by attempting to read nodes
which were stripped).
Pierre-Yves David - May 17, 2017, 9:55 a.m.
On 05/17/2017 08:38 AM, Rodrigo Damazio Bovendorp via Mercurial-devel wrote:
> # HG changeset patch
> # User Rodrigo Damazio Bovendorp <rdamazio@google.com>
> # Date 1495003030 25200
> #      Tue May 16 23:37:10 2017 -0700
> # Node ID 8a19c6e8a1125be6bf6a5c97dc345c37c39a1189
> # Parent  2241433a77e543ee068039fa2fb9ad514decca93
> evolve: fixing obscache invalidation
>
> This was missing a call to the parent's destroyed(), such that any transaction
> after stripping some nodes would result in a crash (by attempting to read nodes
> which were stripped).

That one is pushed, thanks. Since this is the second time in a happens 
in a short while it might be useful to had a small tests for this. Could 
you build that ?

Cheers,
via Mercurial-devel - May 17, 2017, 1:53 p.m.
On Wed, May 17, 2017, 02:55 Pierre-Yves David <
pierre-yves.david@ens-lyon.org> wrote:

> On 05/17/2017 08:38 AM, Rodrigo Damazio Bovendorp via Mercurial-devel
> wrote:
> > # HG changeset patch
> > # User Rodrigo Damazio Bovendorp <rdamazio@google.com>
> > # Date 1495003030 25200
> > #      Tue May 16 23:37:10 2017 -0700
> > # Node ID 8a19c6e8a1125be6bf6a5c97dc345c37c39a1189
> > # Parent  2241433a77e543ee068039fa2fb9ad514decca93
> > evolve: fixing obscache invalidation
> >
> > This was missing a call to the parent's destroyed(), such that any
> transaction
> > after stripping some nodes would result in a crash (by attempting to
> read nodes
> > which were stripped).
>
> That one is pushed, thanks. Since this is the second time in a happens
> in a short while it might be useful to had a small tests for this. Could
> you build that ?
>

I think we'll need some advice on how to do that. We talked about that last
night. Neither of us could think of an easy way to do that. We could
obviously take our set of extensions and trim all of them down until we had
a small test case left, but that seems very time consuming. I don't think
either of us knows the evolve and hg core well enough to even know the bug
could be triggered without our extensions.


> Cheers,
>
> --
> Pierre-Yves David
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Pierre-Yves David - May 17, 2017, 2:10 p.m.
On 05/17/2017 03:53 PM, Martin von Zweigbergk wrote:
>
>
> On Wed, May 17, 2017, 02:55 Pierre-Yves David
> <pierre-yves.david@ens-lyon.org <mailto:pierre-yves.david@ens-lyon.org>>
> wrote:
>
>     On 05/17/2017 08:38 AM, Rodrigo Damazio Bovendorp via
>     Mercurial-devel wrote:
>     > # HG changeset patch
>     > # User Rodrigo Damazio Bovendorp <rdamazio@google.com
>     <mailto:rdamazio@google.com>>
>     > # Date 1495003030 25200
>     > #      Tue May 16 23:37:10 2017 -0700
>     > # Node ID 8a19c6e8a1125be6bf6a5c97dc345c37c39a1189
>     > # Parent  2241433a77e543ee068039fa2fb9ad514decca93
>     > evolve: fixing obscache invalidation
>     >
>     > This was missing a call to the parent's destroyed(), such that any
>     transaction
>     > after stripping some nodes would result in a crash (by attempting
>     to read nodes
>     > which were stripped).
>
>     That one is pushed, thanks. Since this is the second time in a happens
>     in a short while it might be useful to had a small tests for this. Could
>     you build that ?
>
>
> I think we'll need some advice on how to do that. We talked about that
> last night. Neither of us could think of an easy way to do that. We
> could obviously take our set of extensions and trim all of them down
> until we had a small test case left, but that seems very time consuming.
> I don't think either of us knows the evolve and hg core well enough to
> even know the bug could be triggered without our extensions.

I'm not sure what actually triggers it, but having a small extension 
that does both a strip and usage of some stripped revision afterward (in 
a way similar to what was crashing on your side).

We can drop this if this is too complex.

Cheers,

Patch

diff --git a/README b/README
--- a/README
+++ b/README
@@ -119,6 +119,7 @@ 
  - topic: have thg display topic name if possible,
  - obscache: more efficient update in the (rare) case of a transaction adding
    markers without changesets
+ - obscache: fix more cache invalidation propagation
  - obshashrange-cache: update incrementally in the (common) case of a
    transaction not affecting existing range,
  - obshashrange-cache: keep the cache mostly warm after each transaction.
diff --git a/hgext3rd/evolve/obscache.py b/hgext3rd/evolve/obscache.py
--- a/hgext3rd/evolve/obscache.py
+++ b/hgext3rd/evolve/obscache.py
@@ -482,6 +482,7 @@ 
         def destroyed(self):
             if 'obsstore' in vars(self):
                 self.obsstore.obscache.clear()
+            super(obscacherepo, self).destroyed()
 
         def transaction(self, *args, **kwargs):
             tr = super(obscacherepo, self).transaction(*args, **kwargs)