diff --git a/taichi/cache/gfx/cache_manager.cpp b/taichi/cache/gfx/cache_manager.cpp index 6495b03dc3f31..b330aebbd1e97 100644 --- a/taichi/cache/gfx/cache_manager.cpp +++ b/taichi/cache/gfx/cache_manager.cpp @@ -124,7 +124,10 @@ CacheManager::CacheManager(Params &&init_params) if (exists && lock_with_file(lock_path)) { auto _ = make_cleanup([&lock_path]() { if (!unlock_with_file(lock_path)) { - TI_WARN("Unlock {} failed", lock_path); + TI_WARN( + "Unlock {} failed. You can remove this .lock file manually and " + "try again.", + lock_path); } }); gfx::AotModuleParams params; @@ -172,7 +175,10 @@ void CacheManager::dump_with_merging() const { if (lock_with_file(lock_path)) { auto _ = make_cleanup([&lock_path]() { if (!unlock_with_file(lock_path)) { - TI_WARN("Unlock {} failed", lock_path); + TI_WARN( + "Unlock {} failed. You can remove this .lock file manually and " + "try again.", + lock_path); } }); diff --git a/taichi/runtime/llvm/llvm_offline_cache.cpp b/taichi/runtime/llvm/llvm_offline_cache.cpp index 7595e6c2ec1ae..8a9b348b0a76b 100644 --- a/taichi/runtime/llvm/llvm_offline_cache.cpp +++ b/taichi/runtime/llvm/llvm_offline_cache.cpp @@ -130,12 +130,17 @@ bool LlvmOfflineCacheFileReader::load_meta_data( if (lock_with_file(lock_path)) { auto _ = make_cleanup([&lock_path]() { if (!unlock_with_file(lock_path)) { - TI_WARN("Unlock {} failed", lock_path); + TI_WARN( + "Unlock {} failed. You can remove this .lock file manually and try " + "again.", + lock_path); } }); return Error::kNoError == load_metadata_with_checking(data, tcb_path); } - TI_WARN("Lock {} failed", lock_path); + TI_WARN( + "Lock {} failed. You can remove this .lock file manually and try again.", + lock_path); return false; } @@ -313,12 +318,18 @@ void LlvmOfflineCacheFileWriter::dump(const std::string &path, // metadata file format to reduce overhead. std::string lock_path = taichi::join_path(path, kMetadataFileLockName); if (!lock_with_file(lock_path)) { - TI_WARN("Lock {} failed", lock_path); + TI_WARN( + "Lock {} failed. You can remove this .lock file manually and try " + "again.", + lock_path); return; } auto _ = make_cleanup([&lock_path]() { if (!unlock_with_file(lock_path)) { - TI_WARN("Unlock {} failed", lock_path); + TI_WARN( + "Unlock {} failed. You can remove this .lock file manually and try " + "again.", + lock_path); } }); diff --git a/taichi/util/lock.h b/taichi/util/lock.h index edd27469d7068..885f8ef0b711f 100644 --- a/taichi/util/lock.h +++ b/taichi/util/lock.h @@ -58,7 +58,10 @@ inline bool lock_with_file(const std::string &path, inline RaiiCleanup make_unlocker(const std::string &path) { return make_cleanup([&path]() { if (!unlock_with_file(path)) { - TI_WARN("Unlock {} failed", path); + TI_WARN( + "Unlock {} failed. You can remove this .lock file manually and try " + "again.", + path); } }); } diff --git a/taichi/util/offline_cache.h b/taichi/util/offline_cache.h index 0eed139482385..e96aa186f5e96 100644 --- a/taichi/util/offline_cache.h +++ b/taichi/util/offline_cache.h @@ -173,13 +173,19 @@ class CacheCleaner { std::string lock_path = taichi::join_path(path, config.metadata_lock_name); if (!lock_with_file(lock_path)) { - TI_WARN("Lock {} failed", lock_path); + TI_WARN( + "Lock {} failed. You can remove this .lock file manually and try " + "again.", + lock_path); return; } auto _ = make_cleanup([&lock_path]() { TI_DEBUG("Stop cleaning cache"); if (!unlock_with_file(lock_path)) { - TI_WARN("Unlock {} failed", lock_path); + TI_WARN( + "Unlock {} failed. You can remove this .lock file manually and " + "try again.", + lock_path); } }); TI_DEBUG("Start cleaning cache");