From 2029a3b73b661f06fd57caa2d9064e333e48bd90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Thu, 8 Feb 2024 01:43:33 +0100 Subject: [PATCH] Fix a comment documenting the locking rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We only care about concurrency within the scope of HasThreadSafePutBlob. Should not change behavior. Signed-off-by: Miloslav Trmač --- storage/storage_dest.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/storage_dest.go b/storage/storage_dest.go index ae73da4f55..d8b993c9df 100644 --- a/storage/storage_dest.go +++ b/storage/storage_dest.go @@ -74,7 +74,8 @@ type storageImageDestination struct { // `queueOrCommit()` for further details on how the single-caller // guarantee is implemented. indexToStorageID map[int]string - // All accesses to below data are protected by `lock` which is made + // All accesses to below data are, during the concurrent TryReusingBlob/PutBlob/* calls + // (but not necessarily during the final Commit) protected by `lock` which is made // *explicit* in the code. uncompressedOrTocDigest map[digest.Digest]digest.Digest // Mapping from layer blobsums to their corresponding DiffIDs or TOC IDs. fileSizes map[digest.Digest]int64 // Mapping from layer blobsums to their sizes