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
b1706469
Unverified
Commit
b1706469
authored
Jan 11, 2025
by
TianYu GUO
Committed by
GitHub
Jan 10, 2025
Browse files
Fix port number overflow (#2826)
parent
5413ec2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
python/sglang/srt/server_args.py
python/sglang/srt/server_args.py
+4
-1
python/sglang/srt/utils.py
python/sglang/srt/utils.py
+2
-0
No files found.
python/sglang/srt/server_args.py
View file @
b1706469
...
@@ -928,7 +928,10 @@ class PortArgs:
...
@@ -928,7 +928,10 @@ class PortArgs:
while
True
:
while
True
:
if
is_port_available
(
port
):
if
is_port_available
(
port
):
break
break
port
+=
42
if
port
<
60000
:
port
+=
42
else
:
port
-=
43
return
PortArgs
(
return
PortArgs
(
tokenizer_ipc_name
=
tempfile
.
NamedTemporaryFile
(
delete
=
False
).
name
,
tokenizer_ipc_name
=
tempfile
.
NamedTemporaryFile
(
delete
=
False
).
name
,
...
...
python/sglang/srt/utils.py
View file @
b1706469
...
@@ -335,6 +335,8 @@ def is_port_available(port):
...
@@ -335,6 +335,8 @@ def is_port_available(port):
return
True
return
True
except
socket
.
error
:
except
socket
.
error
:
return
False
return
False
except
OverflowError
:
return
False
def
decode_video_base64
(
video_base64
):
def
decode_video_base64
(
video_base64
):
...
...
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