Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
1f44fca7
Unverified
Commit
1f44fca7
authored
Nov 12, 2025
by
Yan Ru Pei
Committed by
GitHub
Nov 12, 2025
Browse files
chore: router slot manager should not panic (#4267)
Signed-off-by:
PeaBrane
<
yanrpei@gmail.com
>
parent
b60132c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
lib/llm/src/kv_router/sequence.rs
lib/llm/src/kv_router/sequence.rs
+12
-4
No files found.
lib/llm/src/kv_router/sequence.rs
View file @
1f44fca7
...
...
@@ -121,9 +121,10 @@ impl ActiveSequences {
isl
:
usize
,
overlap
:
u32
,
)
->
HashSet
<
RequestId
>
{
// Check for double-add and
panic
early
// Check for double-add and
log error, returning
early
if
self
.active_seqs
.contains_key
(
&
request_id
)
{
panic!
(
"Request {request_id} is already active. Cannot accept double-add."
);
tracing
::
error!
(
"Request {request_id} is already active. Ignoring duplicate add."
);
return
HashSet
::
new
();
}
// Lazily check and clean up expired requests, capturing removed IDs
...
...
@@ -160,8 +161,15 @@ impl ActiveSequences {
}
pub
fn
new_tokens
(
&
self
,
isl
:
usize
,
overlap
:
u32
)
->
usize
{
isl
.checked_sub
((
overlap
as
usize
)
*
self
.block_size
)
.unwrap_or_else
(||
panic!
(
"prefill_tokens < 0 with overlap {overlap} and ISL {isl}"
))
let
cached_tokens
=
(
overlap
as
usize
)
*
self
.block_size
;
isl
.checked_sub
(
cached_tokens
)
.unwrap_or_else
(||
{
tracing
::
error!
(
"prefill_tokens < 0 with ISL {isl} < cached_tokens {cached_tokens} (overlap {overlap} * block_size {}), returning 0"
,
self
.block_size
);
0
})
}
pub
fn
potential_blocks_and_tokens
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment