[ARVADOS] updated: 5d157b098bee3e8c31ad11739e50b5f6aac064af

git at public.curoverse.com git at public.curoverse.com
Fri Dec 4 19:09:05 EST 2015


Summary of changes:
 services/datamanager/collection/collection.go | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

       via  5d157b098bee3e8c31ad11739e50b5f6aac064af (commit)
      from  765faab6cd2437a94ceec5b1685e639f72ef8627 (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 5d157b098bee3e8c31ad11739e50b5f6aac064af
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Dec 4 19:18:49 2015 -0500

    Fix manifest stats leaking between runs via globals. No issue #

diff --git a/services/datamanager/collection/collection.go b/services/datamanager/collection/collection.go
index 33970d8..eecfff7 100644
--- a/services/datamanager/collection/collection.go
+++ b/services/datamanager/collection/collection.go
@@ -18,9 +18,6 @@ import (
 
 var (
 	HeapProfileFilename string
-	// globals for debugging
-	totalManifestSize uint64
-	maxManifestSize   uint64
 )
 
 // Collection representation
@@ -200,13 +197,12 @@ func GetCollections(params GetCollectionsParams) (results ReadCollections, err e
 		}
 
 		// Process collection and update our date filter.
-		var latestModificationDate time.Time
-		latestModificationDate, err = ProcessCollections(params.Logger,
+		latestModificationDate, maxManifestSize, totalManifestSize, err := ProcessCollections(params.Logger,
 			collections.Items,
 			defaultReplicationLevel,
 			results.UUIDToCollection)
 		if err != nil {
-			return
+			return results, err
 		}
 		sdkParams["filters"].([][]string)[0][2] = latestModificationDate.Format(time.RFC3339)
 
@@ -250,7 +246,12 @@ func StrCopy(s string) string {
 func ProcessCollections(arvLogger *logger.Logger,
 	receivedCollections []SdkCollectionInfo,
 	defaultReplicationLevel int,
-	UUIDToCollection map[string]Collection) (latestModificationDate time.Time, err error) {
+	UUIDToCollection map[string]Collection,
+) (
+	latestModificationDate time.Time,
+	maxManifestSize, totalManifestSize uint64,
+	err error,
+) {
 	for _, sdkCollection := range receivedCollections {
 		collection := Collection{UUID: StrCopy(sdkCollection.UUID),
 			OwnerUUID:         StrCopy(sdkCollection.OwnerUUID),
@@ -258,12 +259,13 @@ func ProcessCollections(arvLogger *logger.Logger,
 			BlockDigestToSize: make(map[blockdigest.BlockDigest]int)}
 
 		if sdkCollection.ModifiedAt.IsZero() {
-			return latestModificationDate, fmt.Errorf(
+			err = fmt.Errorf(
 				"Arvados SDK collection returned with unexpected zero "+
 					"modification date. This probably means that either we failed to "+
 					"parse the modification date or the API server has changed how "+
 					"it returns modification dates: %+v",
 				collection)
+			return
 		}
 
 		if sdkCollection.ModifiedAt.After(latestModificationDate) {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list