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
002d0373
Unverified
Commit
002d0373
authored
Oct 19, 2025
by
fzyzcjy
Committed by
GitHub
Oct 19, 2025
Browse files
Avoid generation gets hanging when user specifies multiple event loops (#5162)
Co-authored-by:
Yineng Zhang
<
me@zhyncs.com
>
parent
a27825ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
python/sglang/srt/managers/tokenizer_manager.py
python/sglang/srt/managers/tokenizer_manager.py
+6
-3
No files found.
python/sglang/srt/managers/tokenizer_manager.py
View file @
002d0373
...
...
@@ -267,7 +267,7 @@ class TokenizerManager(TokenizerCommunicatorMixin):
)
# Request states
self
.
no_create
_loop
=
Fals
e
self
.
_chosen
_loop
=
Non
e
self
.
rid_to_state
:
Dict
[
str
,
ReqState
]
=
{}
self
.
asyncio_tasks
=
set
()
...
...
@@ -1170,11 +1170,14 @@ class TokenizerManager(TokenizerCommunicatorMixin):
return
background_tasks
def
auto_create_handle_loop
(
self
):
if
self
.
no_create_loop
:
if
self
.
_chosen_loop
is
not
None
:
assert
(
asyncio
.
get_event_loop
()
==
self
.
_chosen_loop
),
f
"Please ensure only one event loop is ever used with SGLang. Previous loop:
{
self
.
_chosen_loop
}
, current loop:
{
asyncio
.
get_event_loop
()
}
"
return
self
.
no_create_loop
=
True
loop
=
asyncio
.
get_event_loop
()
self
.
_chosen_loop
=
loop
self
.
asyncio_tasks
.
add
(
loop
.
create_task
(
print_exception_wrapper
(
self
.
handle_loop
))
)
...
...
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