From c32e7db8e3b86a06bdf45edef037b14c9ea63301 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Mon, 25 Mar 2024 02:50:18 -0400 Subject: [PATCH] [wpiutil] DataLog: Don't constantly retry creating logs when low on space (#6468) When low on space, a log file won't be created. This is detected as a "deletion", and the DataLog thread will continously try to create a log, fail to do so because of low space, detect it as a "deletion", and do so in a loop. If there's not enough space, the DataLog will be marked as stopped, preventing this infinite loop. Calls to start() will hit this code path and mark it as stopped again. --- wpiutil/src/main/native/cpp/DataLog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/wpiutil/src/main/native/cpp/DataLog.cpp b/wpiutil/src/main/native/cpp/DataLog.cpp index bbde5e7b7c..5b4d491c01 100644 --- a/wpiutil/src/main/native/cpp/DataLog.cpp +++ b/wpiutil/src/main/native/cpp/DataLog.cpp @@ -354,6 +354,7 @@ void DataLog::StartLogFile(WriterThreadState& state) { WPI_ERROR(m_msglog, "Insufficient free space ({} available), no log being saved", FormatBytesSize(state.freeSpace)); + m_state = kStopped; } else { // try preferred filename, or randomize it a few times, before giving up for (int i = 0; i < 5; ++i) {