- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 934
.fetch(..., prune=True) might result in BadName: Ref '...' did not resolve to an object #768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Your hypothesis sounds very reasonable. |
Is there a way to pass |
any wisdom shared on this matter would still be appreciated -- this bug haunts us at night (and during a day) |
@yarikoptic It looks like |
With the following change
getting error while running our tests:
Which tells:
|
Since I do not think we could do anything else on our (datalad) end to workaround it, @Byron, do you think it would be feasible to e.g. at this level:
to guard for that BadName exception and if it happens, to reload DB? |
For now worked around in https://github.com/datalad/datalad/pull/2712/files#diff-c13d3ecf2ccb909497bd070a2dd379baL166 by catching this exception, closing/flushing all we typically do for a commit, and then trying to fetch again. Let's see if it shows its ugly face again ;-) |
@yarikoptic Actually I don't know what would be best here, and I would trust your judgement. For now it seems you are good on your end. In case a fix in GitPython is in order, please feel free to submit a PR. |
Original issue/record in DataLad: datalad/datalad#2550
We have been running into this occasional crash across a variety of our unittests, never had time to look in detail, especially since it is very hard to reproduce -- happens only rarely.
The issue is like this traceback (see more in the above datalad issue)
and I am blaming us passing
prune=True
to GitPython's.fetch
which is then passed without any internal handling togit fetch --prune
call, and I am hypothesizing then git deciding to do 'gc', and somehow GitPython's internal gitdb getting out of sync with it and thus BadName. Is that a viable hypothesis? ;-) Anything what could be done on GitPython's end, or may be we could pass-c gc.auto=0
to thatgit fetch
call to disable auto gc?thanks in advance for guidance
The text was updated successfully, but these errors were encountered: