You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by li...@apache.org on 2020/03/22 14:08:11 UTC

[incubator-dolphinscheduler] branch dev updated: when running windows bat script, the handle is invalid in win7 (#2269)

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

lidongdai pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 34e2f67  when running windows bat script, the handle is invalid in win7 (#2269)
34e2f67 is described below

commit 34e2f67e0e23123ec5cede7d58a5c0a8b8a8afbf
Author: liwenhe1993 <32...@users.noreply.github.com>
AuthorDate: Sun Mar 22 22:07:59 2020 +0800

    when running windows bat script, the handle is invalid in win7 (#2269)
---
 .../dolphinscheduler/common/utils/process/ProcessImplForWin32.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/process/ProcessImplForWin32.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/process/ProcessImplForWin32.java
index 9f2716a..bef5bb0 100644
--- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/process/ProcessImplForWin32.java
+++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/process/ProcessImplForWin32.java
@@ -32,6 +32,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import static com.sun.jna.platform.win32.WinBase.INVALID_HANDLE_VALUE;
 import static com.sun.jna.platform.win32.WinBase.STILL_ACTIVE;
 import static java.util.Objects.requireNonNull;
 
@@ -742,7 +743,9 @@ public class ProcessImplForWin32 extends Process {
     }
 
     private static void closeHandle(WinNT.HANDLE handle) {
-        Kernel32Util.closeHandle(handle);
+        if (!handle.equals(INVALID_HANDLE_VALUE)) {
+            Kernel32Util.closeHandle(handle);
+        }
     }
 
     /**