projects
/
arvados.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b8f6c92
)
17698: Add comment to clarify locking.
author
Tom Clegg <tom@curii.com>
Mon, 23 Aug 2021 14:01:40 +0000
(10:01 -0400)
committer
Tom Clegg <tom@curii.com>
Mon, 23 Aug 2021 14:01:40 +0000
(10:01 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>
services/keepstore/handlers.go
patch
|
blob
|
history
diff --git
a/services/keepstore/handlers.go
b/services/keepstore/handlers.go
index 4698d1fafa07ba9dfaff033aa447563449edd369..910033ebb1d8408c90a4bde441d7edc8d99b109a 100644
(file)
--- a/
services/keepstore/handlers.go
+++ b/
services/keepstore/handlers.go
@@
-912,7
+912,11
@@
func PutBlock(ctx context.Context, volmgr *RRVolumeManager, block []byte, hash s
pending := result.Copy()
var allFull atomic.Value
allFull.Store(true)
+
+ // We hold the lock for the duration of the "each volume" loop
+ // below, except when it is released during cond.Wait().
mtx.Lock()
+
for _, mnt := range writables {
// Wait until our decision to use this mount does not
// depend on the outcome of pending writes.