[ARVADOS] updated: 2.1.0-1861-g9f442d51f
Git user
git at public.arvados.org
Fri Jan 28 14:59:16 UTC 2022
Summary of changes:
sdk/go/arvados/fs_collection.go | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
via 9f442d51f9ee07be3b25e461847bae58fe1cd126 (commit)
from e23f03950b82e72de23c4c44112785a9e92ea235 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 9f442d51f9ee07be3b25e461847bae58fe1cd126
Author: Tom Clegg <tom at curii.com>
Date: Fri Jan 28 09:59:06 2022 -0500
16727: Explain guessSignatureTTL field.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/sdk/go/arvados/fs_collection.go b/sdk/go/arvados/fs_collection.go
index d39805f3f..d087fd094 100644
--- a/sdk/go/arvados/fs_collection.go
+++ b/sdk/go/arvados/fs_collection.go
@@ -43,10 +43,18 @@ type CollectionFileSystem interface {
type collectionFileSystem struct {
fileSystem
- uuid string
- savedPDH atomic.Value
- replicas int
- storageClasses []string
+ uuid string
+ savedPDH atomic.Value
+ replicas int
+ storageClasses []string
+ // guessSignatureTTL tracks a lower bound for the server's
+ // configured BlobSigningTTL. The guess is initially zero, and
+ // increases when we come across a signature with an expiry
+ // time further in the future than the previous guess.
+ //
+ // When the guessed TTL is much smaller than the real TTL,
+ // preemptive signature refresh is delayed or missed entirely,
+ // which is OK.
guessSignatureTTL time.Duration
holdCheckChanges time.Time
lockCheckChanges sync.Mutex
@@ -156,8 +164,13 @@ func (fs *collectionFileSystem) signatureTimeLeft() (float64, time.Duration) {
fs.fileSystem.root.Lock()
{
if ttl > fs.guessSignatureTTL {
+ // ttl is closer to the real TTL than
+ // guessSignatureTTL.
fs.guessSignatureTTL = ttl
} else {
+ // Use the previous best guess to compute the
+ // portion remaining (below, after unlocking
+ // mutex).
ttl = fs.guessSignatureTTL
}
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list