You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Serve-path ingest updates .sc index files without a lock (pending list, signature index, drop rewrite) #260
Found while reviewing #254 (#230). LocalTransport::put_pack ingests a pack and then updates derived index files (.sc/signatures via append_index, .sc/transcripts, .sc/transcript-pending via note_pending and the re-evaluation rewrite) without holding RepoLock; the lock covers only update_ref. Two concurrent pushes to a thread-per-connection sc serve --http, or a push racing a local sc command in the served directory, can each read the same file and the last atomic rewrite wins, losing the other's entries.
Impact: a lost signature or transcript index line is rebuilt by sc clone reindex only; a lost pending-tombstone entry costs a push-only remote the retry (the drop line itself is appended with O_APPEND since #254 and cannot be lost this way).
Options: take the repo lock around the post-ingest index updates (check Locked behaviour for concurrent connections and for a local sc command holding the lock for its whole lifetime), or a dedicated short-lived index lock distinct from RepoLock, or make each index file append-only with O_APPEND lines.
Activity
fix(repo): address review of the signature index and index lock (#257, …
fix(repo): hold the index lock across coupled passes, distinct busy e…
fix(repo): verify incoming signatures before taking the index lock (#257
fix(repo): skip trust re-evaluation while the legacy import is pending (
fix(repo): per-signer signature index and an index lock for serve-pat…