From f979a67b04d919618e54c8347d1cdff1aedf7e07 Mon Sep 17 00:00:00 2001 From: Francesco Mazzoli Date: Thu, 18 Jan 2024 15:12:40 +0000 Subject: [PATCH] Always set non-zero transient deadline, fixes #145. --- cpp/shard/ShardDB.cpp | 7 ++----- go/eggstests/cleanup.go | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cpp/shard/ShardDB.cpp b/cpp/shard/ShardDB.cpp index 9e56110c..49d2927f 100644 --- a/cpp/shard/ShardDB.cpp +++ b/cpp/shard/ShardDB.cpp @@ -2598,10 +2598,7 @@ struct ShardDBImpl { v().setVersion(0); v().setFileSize(file().fileSize()); v().setMtime(time); - v().setDeadline(0); - // TODO actually do the below if we end up doing in the kernel, right now I - // don't just because the tests fail otherwise. - // v().setDeadline(time + DEADLINE_INTERVAL); // we might use this to keep writing empty files + v().setDeadline(time + _transientDeadlineInterval); v().setLastSpanState(SpanState::CLEAN); v().setNoteDangerous(entry.name.ref()); ROCKS_DB_CHECKED(batch.Put(_transientCf, k.toSlice(), v.toSlice())); @@ -3123,7 +3120,7 @@ struct ShardDBImpl { transientFile().setVersion(0); transientFile().setFileSize(file().fileSize()); transientFile().setMtime(time); - transientFile().setDeadline(0); + transientFile().setDeadline(time + _transientDeadlineInterval); transientFile().setLastSpanState(SpanState::CLEAN); transientFile().setNoteDangerous(entry.note.ref()); ROCKS_DB_CHECKED(batch.Put(_transientCf, k.toSlice(), transientFile.toSlice())); diff --git a/go/eggstests/cleanup.go b/go/eggstests/cleanup.go index 774527f7..a2dd8c8d 100644 --- a/go/eggstests/cleanup.go +++ b/go/eggstests/cleanup.go @@ -50,7 +50,6 @@ func cleanupAfterTest( counters *lib.ClientCounters, pauseBlockServiceKiller *sync.Mutex, ) { - cleanupStartedAt := time.Now() client, err := lib.NewClient(log, nil, shuckleAddress) if err != nil { panic(err) @@ -71,7 +70,7 @@ func cleanupAfterTest( panic(err) } log.Info("waiting for transient deadlines to have passed") - time.Sleep(testTransientDeadlineInterval - time.Since(cleanupStartedAt)) + time.Sleep(testTransientDeadlineInterval) log.Info("deadlines passed, collecting") { state := &lib.DestructFilesState{}