Fix port number overflow (#2826)
This commit is contained in:
1 parent
5413ec2bbe
commit
b170646991
2 files changed
+6
-1
No files matched your search
@@ -928,7 +928,10 @@ class PortArgs:
|
||||
while True:
|
||||
if is_port_available(port):
|
||||
break
|
||||
port += 42
|
||||
if port < 60000:
|
||||
port += 42
|
||||
else:
|
||||
port -= 43
|
||||
|
||||
return PortArgs(
|
||||
tokenizer_ipc_name=tempfile.NamedTemporaryFile(delete=False).name,
|
||||
|
||||
@@ -335,6 +335,8 @@ def is_port_available(port):
|
||||
return True
|
||||
except socket.error:
|
||||
return False
|
||||
except OverflowError:
|
||||
return False
|
||||
|
||||
|
||||
def decode_video_base64(video_base64):
|
||||
|
||||
Reference in new issue
Block a user