Skip to content

Commit e11fe87

Browse files
njhillcharlifu
authored andcommitted
[BugFix] Exclude self when checking for port collision (vllm-project#25286)
Signed-off-by: Nick Hill <nhill@redhat.com> Signed-off-by: charlifu <charlifu@amd.com>
1 parent 9e54a65 commit e11fe87

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

vllm/utils/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,8 +987,10 @@ def find_process_using_port(port: int) -> Optional[psutil.Process]:
987987
if sys.platform.startswith("darwin"):
988988
return None
989989

990+
our_pid = os.getpid()
990991
for conn in psutil.net_connections():
991-
if conn.laddr.port == port:
992+
if conn.laddr.port == port and (conn.pid is not None
993+
and conn.pid != our_pid):
992994
try:
993995
return psutil.Process(conn.pid)
994996
except psutil.NoSuchProcess:

0 commit comments

Comments
 (0)