You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tephra.apache.org by ja...@apache.org on 2018/06/19 07:50:04 UTC
incubator-tephra git commit: TEPHRA-292 Make client discovery timeout
higher and configurable
Repository: incubator-tephra
Updated Branches:
refs/heads/master 97f73477a -> d0a1c4c29
TEPHRA-292 Make client discovery timeout higher and configurable
Project: http://git-wip-us.apache.org/repos/asf/incubator-tephra/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tephra/commit/d0a1c4c2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tephra/tree/d0a1c4c2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tephra/diff/d0a1c4c2
Branch: refs/heads/master
Commit: d0a1c4c295fd28e68223db220b13dc1b12b326da
Parents: 97f7347
Author: James Taylor <ja...@apache.org>
Authored: Tue Jun 19 09:49:35 2018 +0200
Committer: James Taylor <ja...@apache.org>
Committed: Tue Jun 19 09:49:35 2018 +0200
----------------------------------------------------------------------
tephra-core/src/main/java/org/apache/tephra/TxConstants.java | 7 +++++++
.../org/apache/tephra/distributed/AbstractClientProvider.java | 4 +++-
2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tephra/blob/d0a1c4c2/tephra-core/src/main/java/org/apache/tephra/TxConstants.java
----------------------------------------------------------------------
diff --git a/tephra-core/src/main/java/org/apache/tephra/TxConstants.java b/tephra-core/src/main/java/org/apache/tephra/TxConstants.java
index 1e50888..e5a544a 100644
--- a/tephra-core/src/main/java/org/apache/tephra/TxConstants.java
+++ b/tephra-core/src/main/java/org/apache/tephra/TxConstants.java
@@ -309,6 +309,10 @@ public class TxConstants {
public static final String CFG_DATA_TX_CLIENT_BACKOFF_LIMIT
= "data.tx.client.retry.backoff.limit";
+ /** to specify timeout in seconds for connecting discovery client */
+ public static final String CFG_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC
+ = "data.tx.client.discovery.timeout";
+
/** the default tx client socket timeout in milli seconds. */
public static final int DEFAULT_DATA_TX_CLIENT_TIMEOUT_MS
= 30 * 1000;
@@ -344,6 +348,9 @@ public class TxConstants {
/** default sleep limit is 30 sec. */
public static final int DEFAULT_DATA_TX_CLIENT_BACKOFF_LIMIT
= 30 * 1000;
+
+ /** default client discovery timeout is 10 sec. */
+ public static final int DEFAULT_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC = 10;
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-tephra/blob/d0a1c4c2/tephra-core/src/main/java/org/apache/tephra/distributed/AbstractClientProvider.java
----------------------------------------------------------------------
diff --git a/tephra-core/src/main/java/org/apache/tephra/distributed/AbstractClientProvider.java b/tephra-core/src/main/java/org/apache/tephra/distributed/AbstractClientProvider.java
index 44be459..c74950c 100644
--- a/tephra-core/src/main/java/org/apache/tephra/distributed/AbstractClientProvider.java
+++ b/tephra-core/src/main/java/org/apache/tephra/distributed/AbstractClientProvider.java
@@ -77,7 +77,9 @@ public abstract class AbstractClientProvider implements ThriftClientProvider {
discoveryServiceClient.discover(
configuration.get(TxConstants.Service.CFG_DATA_TX_DISCOVERY_SERVICE_NAME,
TxConstants.Service.DEFAULT_DATA_TX_DISCOVERY_SERVICE_NAME))),
- 2, TimeUnit.SECONDS);
+ configuration.getInt(TxConstants.Service.CFG_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC,
+ TxConstants.Service.DEFAULT_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC),
+ TimeUnit.SECONDS);
}
protected TransactionServiceThriftClient newClient() throws TException {