Fix spiLock deadlocks / frequent watchdog restarts in WarmNodeStore::save() (#10809)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Mike RobbinsandBen Meadors authored and GitHub committed 2026-06-29 06:07:04 -05:00
1 parent 0488a46a3c
commit b44ed4552f
2 files changed
+22 -6

No files matched your search

+8 -2
View File
@@ -354,10 +354,16 @@ void MessageStore::clearAllMessages()
resetMessagePool();
#ifdef FSCom
concurrency::LockGuard guard(spiLock);
SafeFile f(filename.c_str(), false);
uint8_t count = 0;
f.write(&count, 1); // write "0 messages"
// SafeFile already does its own spiLock in its constructor and close().
// Avoid nesting spiLocks, as this will hang until watchdog reset!
{
concurrency::LockGuard guard(spiLock);
f.write(&count, 1); // write "0 messages"
}
f.close();
#endif