Adjust trash_at of log collection to now+2 weeks refs #20378
authorPeter Amstutz <peter.amstutz@curii.com>
Fri, 21 Apr 2023 19:06:24 +0000 (15:06 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Fri, 21 Apr 2023 19:24:05 +0000 (15:24 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

lib/crunchrun/crunchrun.go

index bfd852257d7d3c3b69560320e3541b2b7d70db72..4a514f3d8966ecbdbc3e43f1a526f9427b99b7b6 100644 (file)
@@ -1521,7 +1521,13 @@ func (runner *ContainerRunner) saveLogCollection(final bool) (response arvados.C
        if final {
                updates["is_trashed"] = true
        } else {
-               exp := time.Now().Add(crunchLogUpdatePeriod * 24)
+               // We set trash_at so this collection gets
+               // automatically cleaned up eventually.  It used to be
+               // 12 hours but we had a situation where the API
+               // server was down over a weekend but the containers
+               // kept running such that the log collection got
+               // trashed, so now we make it 2 weeks.  refs #20378
+               exp := time.Now().Add(time.Duration(24*14) * time.Hour)
                updates["trash_at"] = exp
                updates["delete_at"] = exp
        }