sched: an over-cap request would stall every queue behind it

A plugin that declared plugin_words gets a fixed carrier in the batch --
[max_seqs * plugin_words] rows, carved only because the program said how
many words a sequence may carry. The build stage already refuses a
sequence past that bound, but nothing at admission did, and a refused
build restages its step forever: one request carrying more words than the
plugin declared stalls every queue behind it, permanently.

add_locked now reads the same bound the batch carves by (BatchBuilder::
plugin_words_cap, the program's declaration) and refuses an over-cap
request with RAD_E_INVAL, where the server turns it into a clean 400.
The current route caps its own words already; this is the promise no
future route can miss, checked once at the gate every request passes.
This commit is contained in:
fl0l0u committed 2026-11-15 20:38:09 +00:00
1 parent 981cd1e4e1
commit b44f7a9bb1
2 files changed
+11

No files matched your search

+4
View File
@@ -135,6 +135,10 @@ public:
/* The last build's batch for one rank: build()'s result with that rank's slab pointers. */
const RadBatch* batch_for(int rank) const;
/* Program::plugin_words as declared: the most words one request may carry. Admission checks
* it -- the build stage refuses an over-cap sequence, and a refused build restages forever,
* so a request admitted past the cap stalls every queue behind it. */
int64_t plugin_words_cap() const { return pw_cap_; }
/* The last build's slab and offsets on one rank, for the advance. The caller supplies mode,
* round, slot state and inputs (advance.h). */