mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-21 14:55:45 +08:00
[BugFix] Exclude self when checking for port collision (#25286)
Signed-off-by: Nick Hill <nhill@redhat.com> Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
parent
b7c986673d
commit
d897924b45
@ -987,8 +987,10 @@ def find_process_using_port(port: int) -> Optional[psutil.Process]:
|
||||
if sys.platform.startswith("darwin"):
|
||||
return None
|
||||
|
||||
our_pid = os.getpid()
|
||||
for conn in psutil.net_connections():
|
||||
if conn.laddr.port == port:
|
||||
if conn.laddr.port == port and (conn.pid is not None
|
||||
and conn.pid != our_pid):
|
||||
try:
|
||||
return psutil.Process(conn.pid)
|
||||
except psutil.NoSuchProcess:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user