[ARVADOS] updated: 1.2.0-118-g5e41146b3

Git user git at public.curoverse.com
Fri Sep 28 14:41:23 EDT 2018


Summary of changes:
 services/crunch-run/crunchrun.go | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

       via  5e41146b32e4afd9de4eefc22b3c9fef05c471dc (commit)
       via  d514a085a9caa5a48cf939fa505e7c94fd121fb6 (commit)
      from  5d6a2c2e4b85434e9bae1dd0adc27c284cb9ea85 (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 5e41146b32e4afd9de4eefc22b3c9fef05c471dc
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Fri Sep 28 14:40:05 2018 -0400

    10181: Don't set log collection is_trashed until final save.
    
    Setting is_trashed prevents subsequent updates.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index de397891c..be98a3ee1 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -1206,7 +1206,7 @@ func (runner *ContainerRunner) updateLogs() {
 		}
 		saveAtTime = time.Now().Add(crunchLogUpdatePeriod)
 		saveAtSize = runner.LogCollection.Size() + crunchLogUpdateSize
-		saved, err := runner.saveLogCollection()
+		saved, err := runner.saveLogCollection(false)
 		if err != nil {
 			runner.CrunchLog.Printf("error updating log collection: %s", err)
 			continue
@@ -1362,7 +1362,7 @@ func (runner *ContainerRunner) CommitLogs() error {
 		// -- it exists only to send logs to other channels.
 		return nil
 	}
-	saved, err := runner.saveLogCollection()
+	saved, err := runner.saveLogCollection(true)
 	if err != nil {
 		return fmt.Errorf("error saving log collection: %s", err)
 	}
@@ -1372,7 +1372,7 @@ func (runner *ContainerRunner) CommitLogs() error {
 	return nil
 }
 
-func (runner *ContainerRunner) saveLogCollection() (response arvados.Collection, err error) {
+func (runner *ContainerRunner) saveLogCollection(final bool) (response arvados.Collection, err error) {
 	runner.logMtx.Lock()
 	defer runner.logMtx.Unlock()
 	if runner.LogsPDH != nil {
@@ -1384,11 +1384,18 @@ func (runner *ContainerRunner) saveLogCollection() (response arvados.Collection,
 		err = fmt.Errorf("error creating log manifest: %v", err)
 		return
 	}
-	reqBody := arvadosclient.Dict{
-		"collection": arvadosclient.Dict{
-			"is_trashed":    true,
-			"name":          "logs for " + runner.Container.UUID,
-			"manifest_text": mt}}
+	updates := arvadosclient.Dict{
+		"name":          "logs for " + runner.Container.UUID,
+		"manifest_text": mt,
+	}
+	if final {
+		updates["is_trashed"] = true
+	} else {
+		exp := time.Now().Add(crunchLogUpdatePeriod * 24)
+		updates["trash_at"] = exp
+		updates["delete_at"] = exp
+	}
+	reqBody := arvadosclient.Dict{"collection": updates}
 	if runner.logUUID == "" {
 		reqBody["ensure_unique_name"] = true
 		err = runner.ArvClient.Create("collections", reqBody, &response)

commit d514a085a9caa5a48cf939fa505e7c94fd121fb6
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Thu Sep 27 16:56:41 2018 -0400

    10181: Fix up redundant error message.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index e4aacf56d..de397891c 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -1364,7 +1364,7 @@ func (runner *ContainerRunner) CommitLogs() error {
 	}
 	saved, err := runner.saveLogCollection()
 	if err != nil {
-		return err
+		return fmt.Errorf("error saving log collection: %s", err)
 	}
 	runner.logMtx.Lock()
 	defer runner.logMtx.Unlock()
@@ -1396,7 +1396,6 @@ func (runner *ContainerRunner) saveLogCollection() (response arvados.Collection,
 		err = runner.ArvClient.Update("collections", runner.logUUID, reqBody, &response)
 	}
 	if err != nil {
-		err = fmt.Errorf("error saving log collection: %v", err)
 		return
 	}
 	runner.logUUID = response.UUID

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list