Archived
lora: an unload of an adapter in use drains it instead of answering 409
POST /v1/unload_lora_adapter for an adapter requests still hold marks it draining and answers
202 {"action": "draining", "lora_name", "in_flight": N}: from then on a request naming it gets the
404 an unknown model gets and /v1/models leaves it out, the N requests finish normally, and the
last hold to go frees the slot, which then cools for three step-loop rounds like any freed slot.
An idle adapter still unloads at once with 200; a second unload while it drains answers 202 with
the count as it is then, and 404 once it is gone; a load of the same name while it drains answers
409 (is being unloaded).
The slots' bookkeeping moves out of Engine into lora::SlotTable (core/lora/slots.h): reserve,
publish, acquire with its hold, unload, names. It has its own lock, so a request's hold and an
unload no longer wait behind a load's device copy; Engine::lora_mu_ now only serialises loads,
which is what keeps a reserved slot from being handed out twice. lora_test drives the table
through both paths, and server_test drives the routes over a real table with a streamed request
held open: 200 idle, 202 draining twice, 404 for a new request and on /v1/models/:id, 409 for a
load while draining, the slot freed when the stream ends, 503 while it cools, 200 after.
This commit is contained in:
1 parent
582cda0a53
commit
91127395ee
10 files changed
+495
-93
No files matched your search
+3
-1
@@ -2086,7 +2086,9 @@ int Engine::run_server() {
|
||||
o.lora_load = [this](const std::string& n, const std::string& d, std::string* e) {
|
||||
return lora_load(n, d, e);
|
||||
};
|
||||
o.lora_unload = [this](const std::string& n, std::string* e) { return lora_unload(n, e); };
|
||||
o.lora_unload = [this](const std::string& n, std::string* e, int* in_flight) {
|
||||
return lora_unload(n, e, in_flight);
|
||||
};
|
||||
}
|
||||
|
||||
/* Media, when the program declared an encoder. The processor's geometry comes from the
|
||||
|
||||
Reference in new issue
Block a user