From 90966ccdf1704aad12df913c7e18fd9e5846166a Mon Sep 17 00:00:00 2001 From: Domenico Francesco Bruscino Date: Wed, 31 Aug 2022 08:45:31 +0200 Subject: [PATCH] ARTEMIS-3964 Fix default ping commands timeout for Windows The ping command on Windows uses -w timeout in milliseconds. --- .../activemq/artemis/core/server/NetworkHealthCheck.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java index 022ee8ea30..a141a18274 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java @@ -50,9 +50,9 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent { private final Set urls = new ConcurrentHashSet<>(); private NetworkInterface networkInterface; - public static final String IPV6_DEFAULT_COMMAND = Env.isWindowsOs() ? "ping -n 1 -w %d %s" : "ping6 -c 1 %2$s"; + public static final String IPV6_DEFAULT_COMMAND = Env.isWindowsOs() ? "ping -n 1 -w %d000 %s" : "ping6 -c 1 %2$s"; - public static final String IPV4_DEFAULT_COMMAND = Env.isMacOs() ? "ping -c 1 -t %d %s" : Env.isWindowsOs() ? "cmd /C ping -n 1 -w %d %s | findstr /i TTL" : "ping -c 1 -w %d %s"; + public static final String IPV4_DEFAULT_COMMAND = Env.isMacOs() ? "ping -c 1 -t %d %s" : Env.isWindowsOs() ? "cmd /C ping -n 1 -w %d000 %s | findstr /i TTL" : "ping -c 1 -w %d %s"; private String ipv4Command = IPV4_DEFAULT_COMMAND;