mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-01-26 07:44:31 +08:00
[BugFix] Exclude self when checking for port collision (#25286)
Signed-off-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
parent
3642909617
commit
b7f186bbb3
@ -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