Patchwork [remotefilelog-ext,v2] fileserverclient: avoid ever requesting nullid nodes

login
register
mail settings
Submitter Augie Fackler
Date Oct. 25, 2016, 12:35 a.m.
Message ID <2dbede85d40dec875be2.1477355720@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/17188/
State Accepted
Headers show

Comments

Augie Fackler - Oct. 25, 2016, 12:35 a.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1477347305 14400
#      Mon Oct 24 18:15:05 2016 -0400
# Node ID 2dbede85d40dec875be2df0442aa74982e56995d
# Parent  be571104d9f7292cd218dbb1aaebda9ac0b6315f
fileserverclient: avoid ever requesting nullid nodes

I keep tripping over bugs where this angers some part of our
stack. It's dumb to even be fetching these, but it's harmless to skip
them, so issue a developer warning when we encounter one and refuse to
fetch it.
Durham Goode - Oct. 25, 2016, 7:30 p.m.
Pushed (with minor fix up since ‘node’ is no longer imported in that file). Thanks!

On 10/24/16, 5:35 PM, "Augie Fackler" <raf@durin42.com> wrote:

># HG changeset patch

># User Augie Fackler <augie@google.com>

># Date 1477347305 14400

>#      Mon Oct 24 18:15:05 2016 -0400

># Node ID 2dbede85d40dec875be2df0442aa74982e56995d

># Parent  be571104d9f7292cd218dbb1aaebda9ac0b6315f

>fileserverclient: avoid ever requesting nullid nodes

>

>I keep tripping over bugs where this angers some part of our

>stack. It's dumb to even be fetching these, but it's harmless to skip

>them, so issue a developer warning when we encounter one and refuse to

>fetch it.

>

>diff --git a/remotefilelog/fileserverclient.py b/remotefilelog/fileserverclient.py

>--- a/remotefilelog/fileserverclient.py

>+++ b/remotefilelog/fileserverclient.py

>@@ -577,6 +577,15 @@ class fileserverclient(object):

>         if fetchhistory:

>             missingids.update(historystore.getmissing(idstocheck))

> 

>+        # partition missing nodes into nullid and not-nullid so we can

>+        # warn about this filtering potentially shadowing bugs.

>+        nullids = len([None for unused, id in missingids if id == node.nullid])

>+        if nullids:

>+            missingids = [(f, id) for f, id in missingids if id != node.nullid]

>+            repo.ui.develwarn(

>+                ('remotefilelog not fetching %d null revs'

>+                 ' - this is likely hiding bugs' % nullids),

>+                config='remotefilelog-ext')

>         if missingids:

>             global fetches, fetched, fetchcost

>             fetches += 1

Patch

diff --git a/remotefilelog/fileserverclient.py b/remotefilelog/fileserverclient.py
--- a/remotefilelog/fileserverclient.py
+++ b/remotefilelog/fileserverclient.py
@@ -577,6 +577,15 @@  class fileserverclient(object):
         if fetchhistory:
             missingids.update(historystore.getmissing(idstocheck))
 
+        # partition missing nodes into nullid and not-nullid so we can
+        # warn about this filtering potentially shadowing bugs.
+        nullids = len([None for unused, id in missingids if id == node.nullid])
+        if nullids:
+            missingids = [(f, id) for f, id in missingids if id != node.nullid]
+            repo.ui.develwarn(
+                ('remotefilelog not fetching %d null revs'
+                 ' - this is likely hiding bugs' % nullids),
+                config='remotefilelog-ext')
         if missingids:
             global fetches, fetched, fetchcost
             fetches += 1