This is an automated email from the ASF dual-hosted git repository.

JackieTien97 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new e1baa97f2db [Fix] Stop only the listening DataNode process in Windows 
stop-datanode.bat (#18883)
e1baa97f2db is described below

commit e1baa97f2dbbeffd9073b516fb88c8ef31bc6a62
Author: Jackie Tien <[email protected]>
AuthorDate: Thu Oct 15 14:22:18 2026 +0800

    [Fix] Stop only the listening DataNode process in Windows stop-datanode.bat 
(#18883)
---
 scripts/sbin/windows/stop-datanode.bat | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/sbin/windows/stop-datanode.bat 
b/scripts/sbin/windows/stop-datanode.bat
index a9611fab86c..76b44e13a50 100644
--- a/scripts/sbin/windows/stop-datanode.bat
+++ b/scripts/sbin/windows/stop-datanode.bat
@@ -62,7 +62,10 @@ if not defined dn_rpc_port (
 
 echo Check whether the rpc_port is used..., port is %dn_rpc_port%
 
-for /f "tokens=5" %%a in ('netstat /ano ^| findstr :%dn_rpc_port% ') do (
+@REM Only stop the process listening on dn_rpc_port: other rows with this port 
belong to clients
+@REM connected to it (CLI, Session applications, ...) or to TIME_WAIT sockets 
(PID 0).
+@REM Listening sockets are matched by their foreign port 0 because the State 
column is localized.
+for /f "tokens=5" %%a in ('netstat /ano ^| findstr /c:":%dn_rpc_port% " ^| 
findstr /c:":0 "') do (
   taskkill /f /pid %%a
   echo Close DataNode, PID: %%a
 )

Reply via email to