mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-29 09:27:33 -05:00
server : drop the stale monitor thread join in remove()
Assisted-by: pi:llama.cpp/DeepSeek-V4.1-Flash
This commit is contained in:
@@ -1398,21 +1398,9 @@ bool server_models::remove(const std::string & name) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// on the cancelled-download path the status flips to DOWNLOADED while the
|
||||
// monitoring thread still has a mutex-guarded step left, so joining under
|
||||
// the lock would deadlock - join outside, as load_models() does
|
||||
std::thread th = std::move(it->second.th);
|
||||
mapping.erase(name);
|
||||
lk.unlock();
|
||||
|
||||
// join first so the monitoring thread's final mutex-guarded cleanup cannot
|
||||
// race the disk removal, then remove from disk without holding the lock
|
||||
// (best-effort: cancelled downloads may have no cached files)
|
||||
if (th.joinable()) {
|
||||
th.join();
|
||||
}
|
||||
|
||||
// remove from disk (best-effort: cancelled downloads may have no cached files)
|
||||
bool ok = common_download_remove(name);
|
||||
mapping.erase(name);
|
||||
|
||||
if (!ok) {
|
||||
SRV_WRN("removing model name=%s from disk returned false (no cached files?)\n", name.c_str());
|
||||
|
||||
Reference in New Issue
Block a user