assistant: Fix a race condition that could cause a pointer file to get ingested into the annex
This was caused by commit fb8ab2469d
putting
an isPointerFile check in the wrong place. So if the file was not a pointer
file at that point, but got replaced by one before the file got locked
down, the pointer file would be ingested into the annex.
The fix is simply to move the isPointerFile check to after safeToAdd locks
down the file. Now if the file changes to a pointer file after the
isPointerFile check, ingestion will see that it changed after lockdown,
and will refuse to add it to the annex.
Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
This commit is contained in:
parent
a65068fb66
commit
12a0ca9656
5 changed files with 45 additions and 8 deletions
|
@ -104,3 +104,6 @@ on laptop where I dive into inception: 10.20240129
|
|||
|
||||
[[!meta author=yoh]]
|
||||
[[!tag projects/repronim]]
|
||||
|
||||
[[!meta title="inception: pointer file can be ingested into the annex due to assistant bug or manually"]]
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
[[!comment format=mdwn
|
||||
username="joey"
|
||||
subject="""comment 7"""
|
||||
date="2024-07-02T16:15:28Z"
|
||||
content="""
|
||||
I've fixed this race in the assistant.
|
||||
|
||||
Question now is, can this bug be closed, or does it need to be left open,
|
||||
and git-annex made to recover from this situation? Given the complexity
|
||||
of making git-annex notice this, I'm sort of inclined to not have it
|
||||
auto-recover. Manual recovery seems pretty simple, just delete the file and
|
||||
re-add it with the right key.
|
||||
|
||||
Thoughts?
|
||||
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue