Skip to content

Commit 71cacf2

Browse files
Bihan  RanaBihan  Rana
authored andcommitted
Resolve all major comments
1 parent e5653c8 commit 71cacf2

File tree

1 file changed

+5
-2
lines changed
  • src/dstack/_internal/proxy/gateway/model_routers

1 file changed

+5
-2
lines changed

src/dstack/_internal/proxy/gateway/model_routers/sglang.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,11 @@ def update_replicas(self, replica_urls: List[str]) -> None:
142142
for worker in current_workers:
143143
url = worker.get("url")
144144
if url and isinstance(url, str):
145-
current_worker_urls.add(url)
146-
target_worker_urls = set(replica_urls)
145+
# Normalize URL by removing trailing slashes to avoid path artifacts
146+
normalized_url = url.rstrip("/")
147+
current_worker_urls.add(normalized_url)
148+
# Normalize target URLs to ensure consistent comparison
149+
target_worker_urls = {url.rstrip("/") for url in replica_urls}
147150

148151
# Workers to add
149152
workers_to_add = target_worker_urls - current_worker_urls

0 commit comments

Comments
 (0)