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
e66f3267
Unverified
Commit
e66f3267
authored
Feb 23, 2026
by
Yan Ru Pei
Committed by
GitHub
Feb 23, 2026
Browse files
fix: derive kv-router discovery name from target worker component (#6475)
Signed-off-by:
PeaBrane
<
yanrpei@gmail.com
>
parent
3097adb2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
10 deletions
+14
-10
lib/llm/src/discovery/model_manager.rs
lib/llm/src/discovery/model_manager.rs
+3
-2
lib/llm/src/kv_router.rs
lib/llm/src/kv_router.rs
+5
-6
lib/llm/src/kv_router/subscriber.rs
lib/llm/src/kv_router/subscriber.rs
+6
-2
No files found.
lib/llm/src/discovery/model_manager.rs
View file @
e66f3267
...
...
@@ -419,8 +419,9 @@ impl ModelManager {
let
instance_id
=
discovery
.instance_id
();
// Build transport for router endpoint based on request plane mode
// Use KV_ROUTER_COMPONENT as the component name to distinguish from the generate endpoint's component
let
router_endpoint_id
=
router_endpoint_id
(
endpoint
.id
()
.namespace
);
// Use the worker's component name so each target pool gets its own router discovery group
let
router_endpoint_id
=
router_endpoint_id
(
endpoint
.id
()
.namespace
,
endpoint
.id
()
.component
);
let
transport
=
build_transport_type
(
endpoint
,
&
router_endpoint_id
,
instance_id
)
.await
?
;
let
discovery_spec
=
DiscoverySpec
::
Endpoint
{
...
...
lib/llm/src/kv_router.rs
View file @
e66f3267
...
...
@@ -88,23 +88,22 @@ pub fn worker_kv_indexer_query_endpoint(dp_rank: DpRank) -> String {
}
// for router discovery registration
pub
const
KV_ROUTER_COMPONENT
:
&
str
=
"kv-router"
;
pub
const
KV_ROUTER_ENDPOINT
:
&
str
=
"generate"
;
pub
const
KV_ROUTER_ENDPOINT
:
&
str
=
"router-discovery"
;
/// Creates an EndpointId for the KV router in the given namespace.
pub
fn
router_endpoint_id
(
namespace
:
String
)
->
EndpointId
{
pub
fn
router_endpoint_id
(
namespace
:
String
,
component
:
String
)
->
EndpointId
{
EndpointId
{
namespace
,
component
:
KV_ROUTER_COMPONENT
.to_string
()
,
component
,
name
:
KV_ROUTER_ENDPOINT
.to_string
(),
}
}
/// Creates a DiscoveryQuery for the KV router in the given namespace.
pub
fn
router_discovery_query
(
namespace
:
String
)
->
DiscoveryQuery
{
pub
fn
router_discovery_query
(
namespace
:
String
,
component
:
String
)
->
DiscoveryQuery
{
DiscoveryQuery
::
Endpoint
{
namespace
,
component
:
KV_ROUTER_COMPONENT
.to_string
()
,
component
,
endpoint
:
KV_ROUTER_ENDPOINT
.to_string
(),
}
}
...
...
lib/llm/src/kv_router/subscriber.rs
View file @
e66f3267
...
...
@@ -282,7 +282,8 @@ pub async fn start_kv_router_background(
// Watch for router deletions to clean up orphaned consumers via discovery
let
generate_endpoint
=
component
.endpoint
(
"generate"
);
let
discovery_client
=
component
.drt
()
.discovery
();
let
router_discovery_key
=
router_discovery_query
(
component
.namespace
()
.name
());
let
router_discovery_key
=
router_discovery_query
(
component
.namespace
()
.name
(),
component
.name
()
.to_string
());
let
mut
router_event_stream
=
discovery_client
.list_and_watch
(
router_discovery_key
,
Some
(
cancellation_token
.clone
()))
.await
?
;
...
...
@@ -572,7 +573,10 @@ async fn cleanup_orphaned_consumers(
// Get active routers from discovery
let
discovery
=
component
.drt
()
.discovery
();
let
Ok
(
router_instances
)
=
discovery
.list
(
router_discovery_query
(
component
.namespace
()
.name
()))
.list
(
router_discovery_query
(
component
.namespace
()
.name
(),
component
.name
()
.to_string
(),
))
.await
else
{
tracing
::
debug!
(
"Failed to list router instances from discovery, skipping cleanup"
);
...
...
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