From: Ben Soares Date: Mon, 1 Jul 2019 14:21:00 +0000 (+0100) Subject: JAL-3332 Sensible default timeout values for network connections (8s connect_timeout... X-Git-Tag: Release_2_11_0~2^2~18 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=3abe237a90f4392dd783632265fc401cfb937a92 JAL-3332 Sensible default timeout values for network connections (8s connect_timeout, 15s read_timeout) --- diff --git a/getdown/lib/getdown-core.jar b/getdown/lib/getdown-core.jar index 397dc49..3461a3a 100644 Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ diff --git a/getdown/lib/getdown-launcher.jar b/getdown/lib/getdown-launcher.jar index f7fcbfc..9a700d7 100644 Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ diff --git a/getdown/src/getdown/ant/pom.xml b/getdown/src/getdown/ant/pom.xml index 7f35d44..a2f95e3 100644 --- a/getdown/src/getdown/ant/pom.xml +++ b/getdown/src/getdown/ant/pom.xml @@ -4,7 +4,7 @@ com.threerings.getdown getdown - 1.8.3-1.1.2_JVL + 1.8.3-1.1.4_JVL getdown-ant diff --git a/getdown/src/getdown/core/pom.xml b/getdown/src/getdown/core/pom.xml index 2350118..4cd0507 100644 --- a/getdown/src/getdown/core/pom.xml +++ b/getdown/src/getdown/core/pom.xml @@ -4,7 +4,7 @@ com.threerings.getdown getdown - 1.8.3-1.1.2_JVL + 1.8.3-1.1.4_JVL getdown-core @@ -35,6 +35,8 @@ separated by commas (app1.foo.com,app2.bar.com,app3.baz.com). --> jalview.org,*.jalview.org + 8 + 15 @@ -83,6 +85,8 @@ + + diff --git a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Build.java.tmpl b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Build.java.tmpl index 60a8ff3..86ea47b 100644 --- a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Build.java.tmpl +++ b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Build.java.tmpl @@ -40,4 +40,26 @@ public class Build { public static List hostWhitelist () { return Arrays.asList(StringUtil.parseStringArray("@host_whitelist@")); } + + /* + *

The default connect_timeout to use. Overridden by system property of the same name at runtime + */ + public static int defaultConnectTimeout () { + try { + return Integer.valueOf("@connect_timeout@"); + } catch (Exception e) { + return 0; + } + } + + /* + *

The default read_timeout to use. Overridden by system property of the same name at runtime + */ + public static int defaultReadTimeout () { + try { + return Integer.valueOf("@read_timeout@"); + } catch (Exception e) { + return 30; + } + } } diff --git a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/SysProps.java b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/SysProps.java index 0d96ecb..8550461 100644 --- a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/SysProps.java +++ b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/SysProps.java @@ -9,6 +9,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import com.threerings.getdown.util.VersionUtil; +import com.threerings.getdown.data.Build; /** * This class encapsulates all system properties that are read and processed by Getdown. Don't @@ -106,7 +107,7 @@ public class SysProps * to more quickly timeout its startup update check if the server with which it is * communicating is not available. Usage: {@code -Dconnect_timeout=N}. */ public static int connectTimeout () { - return Integer.getInteger("connect_timeout", 0); + return Integer.getInteger("connect_timeout", Build.defaultConnectTimeout()); } /** Specifies the read timeout (in seconds) to use when downloading all files from the server. @@ -114,7 +115,7 @@ public class SysProps * update process wil fail. Setting the timeout to zero (or a negative value) will disable it. * Usage: {@code -Dread_timeout=N}. */ public static int readTimeout () { - return Integer.getInteger("read_timeout", 30); + return Integer.getInteger("read_timeout", Build.defaultReadTimeout()); } /** Returns the number of threads used to perform digesting and verifying operations in diff --git a/getdown/src/getdown/launcher/pom.xml b/getdown/src/getdown/launcher/pom.xml index b809235..4c6b982 100644 --- a/getdown/src/getdown/launcher/pom.xml +++ b/getdown/src/getdown/launcher/pom.xml @@ -4,7 +4,7 @@ com.threerings.getdown getdown - 1.8.3-1.1.2_JVL + 1.8.3-1.1.4_JVL getdown-launcher diff --git a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages.properties b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages.properties index 19b5069..bb31a7b 100644 --- a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages.properties +++ b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages.properties @@ -111,3 +111,4 @@ m.invalid_digest_file = The digest file is invalid. # When at 0% m.initialising = Initialising +m.starting = Starting diff --git a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_de.properties b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_de.properties index 9a60ccd..ff0a388 100644 --- a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_de.properties +++ b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_de.properties @@ -117,3 +117,4 @@ m.invalid_digest_file = Die Hashwertedatei ist ung\u00fcltig. # When at 0% m.initialising = Initialising +m.starting = Starting diff --git a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_es.properties b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_es.properties index ca01010..00acad0 100644 --- a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_es.properties +++ b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_es.properties @@ -116,3 +116,4 @@ m.invalid_digest_file = El archivo digest no es v\u00e1lido. # When at 0% m.initialising = Initialising +m.starting = Starting diff --git a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_fr.properties b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_fr.properties index 73b8b7f..477830e 100644 --- a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_fr.properties +++ b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_fr.properties @@ -112,3 +112,4 @@ m.invalid_digest_file = Le fichier digest est invalide. # When at 0% m.initialising = Initialising +m.starting = Starting diff --git a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_it.properties b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_it.properties index 2f4f701..d5e3659 100644 --- a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_it.properties +++ b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_it.properties @@ -115,3 +115,4 @@ m.invalid_digest_file = Il file di digest non è valido. # When at 0% m.initialising = Initialising +m.starting = Starting diff --git a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_ja.properties b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_ja.properties index 7865ab3..7eabcdc 100644 --- a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_ja.properties +++ b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_ja.properties @@ -108,3 +108,4 @@ m.invalid_digest_file = \u30c0\u30a4\u30b8\u30a7\u30b9\u30c8\u30d5\u30a1\u30a4\u # When at 0% m.initialising = Initialising +m.starting = Starting diff --git a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_ko.properties b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_ko.properties index 0968c43..dbb45f4 100644 --- a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_ko.properties +++ b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_ko.properties @@ -103,3 +103,4 @@ m.invalid_digest_file = \uB2E4\uC774\uC81C\uC2A4\uD2B8 \uD30C\uC77C\uC774 \uC798 # When at 0% m.initialising = Initialising +m.starting = Starting diff --git a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_pt.properties b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_pt.properties index 71e19df..c9e0be1 100644 --- a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_pt.properties +++ b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_pt.properties @@ -119,3 +119,4 @@ m.invalid_digest_file = O arquivo digest \u00E9 inv\u00E1lido. # When at 0% m.initialising = Initialising +m.starting = Starting diff --git a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_zh.properties b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_zh.properties index 33e0a86..33117ff 100644 --- a/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_zh.properties +++ b/getdown/src/getdown/launcher/src/main/resources/com/threerings/getdown/messages_zh.properties @@ -62,3 +62,4 @@ m.invalid_digest_file = \u65e0\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u3002 # When at 0% m.initialising = Initialising +m.starting = Starting diff --git a/getdown/src/getdown/mvn_cmd b/getdown/src/getdown/mvn_cmd index 6a14aea..fd7c716 100755 --- a/getdown/src/getdown/mvn_cmd +++ b/getdown/src/getdown/mvn_cmd @@ -3,7 +3,7 @@ if [ x$JVLVERSION != x ]; then export VERSION=$JVLVERSION else - export VERSION=1.8.3-1.0_JVL + export VERSION=1.8.3-1.1.4_JVL fi if [ x${VERSION%_JVL} = x$VERSION ]; then @@ -14,7 +14,7 @@ echo "Setting VERSION to '$VERSION'" perl -p -i -e 's|()[^<]*JVL[^<]*()|${1}$ENV{VERSION}${2}|;' pom.xml */pom.xml -mvn package -Dgetdown.host.whitelist="jalview.org,*.jalview.org" +mvn package -Dgetdown.host.whitelist="jalview.org,*.jalview.org" -Dconnect_timeout=8 -Dread_timeout=15 RET=$? if [ x$RET = x0 ]; then cp launcher/target/getdown-launcher-$VERSION.jar ../../../getdown/lib/getdown-launcher.jar && echo "Copied getdown-launcher.jar to getdown/lib" diff --git a/getdown/src/getdown/pom.xml b/getdown/src/getdown/pom.xml index 64555e0..24efba8 100644 --- a/getdown/src/getdown/pom.xml +++ b/getdown/src/getdown/pom.xml @@ -10,7 +10,7 @@ com.threerings.getdown getdown pom - 1.8.3-1.1.2_JVL + 1.8.3-1.1.4_JVL getdown An application installer and updater. diff --git a/j11lib/getdown-core.jar b/j11lib/getdown-core.jar index 397dc49..3461a3a 100644 Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ diff --git a/j8lib/getdown-core.jar b/j8lib/getdown-core.jar index 397dc49..3461a3a 100644 Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ