Skip to content

[Potential Bug] race condition with pack jobs updating root CID #474

@parkan

Description

@parkan

the current implementation has a potential race condition risk because when multiple workers execute pack jobs they race to set the root CID value; if for example the next-to-last job completes after the last it may set the root cid in such a way that a part of the tree will be missing

we need to add a test for this, specifically for the case where the last job is very fast due to having a much smaller hanging segment, or factor out the root cid write into a separate job

there is a transaction to guard against the conflict but the retry may not incorporate directories added by the task that "won" previously if they are on a different sub-tree

need to double-check this

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions