Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
b6909aa2
"vscode:/vscode.git/clone" did not exist on "5fbb33e73dd1b05426882829875e143068a84482"
Unverified
Commit
b6909aa2
authored
May 17, 2025
by
ishandhanani
Committed by
GitHub
May 17, 2025
Browse files
fix: allow `launch_dummy_health_check_server` to start inside of running asyncio loop (#6330)
parent
f8728357
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
python/sglang/srt/utils.py
python/sglang/srt/utils.py
+18
-2
No files found.
python/sglang/srt/utils.py
View file @
b6909aa2
...
...
@@ -1847,6 +1847,8 @@ def get_cuda_version():
def
launch_dummy_health_check_server
(
host
,
port
):
import
asyncio
import
uvicorn
from
fastapi
import
FastAPI
,
Response
...
...
@@ -1862,13 +1864,27 @@ def launch_dummy_health_check_server(host, port):
"""Check the health of the http server."""
return
Response
(
status_code
=
200
)
uvicorn
.
run
(
config
=
uvicorn
.
Config
(
app
,
host
=
host
,
port
=
port
,
timeout_keep_alive
=
5
,
loop
=
"uvloop"
,
loop
=
"auto"
,
log_config
=
None
,
log_level
=
"warning"
,
)
server
=
uvicorn
.
Server
(
config
=
config
)
try
:
loop
=
asyncio
.
get_running_loop
()
logger
.
info
(
f
"Dummy health check server scheduled on existing loop at
{
host
}
:
{
port
}
"
)
loop
.
create_task
(
server
.
serve
())
except
RuntimeError
:
logger
.
info
(
f
"Starting dummy health check server at
{
host
}
:
{
port
}
"
)
server
.
run
()
def
create_checksum
(
directory
:
str
):
...
...
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