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
da59c6ae
Unverified
Commit
da59c6ae
authored
Dec 18, 2025
by
jthomson04
Committed by
GitHub
Dec 18, 2025
Browse files
fix: Don't recursively drop blocks in KVBM (#4995)
Signed-off-by:
jthomson04
<
jwillthomson19@gmail.com
>
parent
15b49818
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
lib/llm/src/block_manager/block.rs
lib/llm/src/block_manager/block.rs
+20
-0
No files found.
lib/llm/src/block_manager/block.rs
View file @
da59c6ae
...
@@ -650,6 +650,26 @@ impl<S: Storage, L: LocalityProvider, M: BlockMetadata> Drop for MutableBlock<S,
...
@@ -650,6 +650,26 @@ impl<S: Storage, L: LocalityProvider, M: BlockMetadata> Drop for MutableBlock<S,
{
{
tracing
::
warn!
(
"block pool shutdown before block was returned"
);
tracing
::
warn!
(
"block pool shutdown before block was returned"
);
}
}
// Iteratively drop the parent chain to avoid stack overflow.
// Without this, dropping a leaf block with thousands of ancestors would cause
// thousands of nested drop() calls, overflowing the stack.
let
mut
current_parent
=
self
.parent
.take
();
while
let
Some
(
arc_parent
)
=
current_parent
{
// Try to get exclusive ownership of the parent
match
Arc
::
try_unwrap
(
arc_parent
)
{
Ok
(
mut
parent
)
=>
{
// We own this parent exclusively - take its parent to continue the chain.
// When `parent` drops at the end of this scope, its `parent` field is None,
// so no recursive drop occurs.
current_parent
=
parent
.parent
.take
();
}
Err
(
_
)
=>
{
// Someone else has a reference to this parent, they'll handle the drop
break
;
}
}
}
}
}
}
}
...
...
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