From 76267afabfe3dbc9cc81d6de9e2d9122d279c5d7 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Sun, 13 Sep 2020 17:12:25 -0500 Subject: [PATCH] Increase timeouts --- .../src/main/java/bisq/core/trade/protocol/TradeProtocol.java | 2 +- p2p/src/main/java/bisq/network/http/HttpClientImpl.java | 4 ++-- p2p/src/main/java/bisq/network/p2p/network/Connection.java | 2 +- .../bisq/network/p2p/peers/getdata/GetDataRequestHandler.java | 2 +- .../p2p/peers/peerexchange/GetPeersRequestHandler.java | 2 +- .../network/p2p/peers/peerexchange/PeerExchangeHandler.java | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/bisq/core/trade/protocol/TradeProtocol.java b/core/src/main/java/bisq/core/trade/protocol/TradeProtocol.java index c561b242741..f1595ca6205 100644 --- a/core/src/main/java/bisq/core/trade/protocol/TradeProtocol.java +++ b/core/src/main/java/bisq/core/trade/protocol/TradeProtocol.java @@ -66,7 +66,7 @@ @Slf4j public abstract class TradeProtocol { - private static final long TIMEOUT = 90; + private static final long TIMEOUT = 180; protected final ProcessModel processModel; private final DecryptedDirectMessageListener decryptedDirectMessageListener; diff --git a/p2p/src/main/java/bisq/network/http/HttpClientImpl.java b/p2p/src/main/java/bisq/network/http/HttpClientImpl.java index e85c7e7efff..8c298b83c41 100644 --- a/p2p/src/main/java/bisq/network/http/HttpClientImpl.java +++ b/p2p/src/main/java/bisq/network/http/HttpClientImpl.java @@ -123,8 +123,8 @@ public String requestWithGETNoProxy(String param, try { connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); - connection.setConnectTimeout((int) TimeUnit.SECONDS.toMillis(30)); - connection.setReadTimeout((int) TimeUnit.SECONDS.toMillis(30)); + connection.setConnectTimeout((int) TimeUnit.SECONDS.toMillis(120)); + connection.setReadTimeout((int) TimeUnit.SECONDS.toMillis(120)); connection.setRequestProperty("User-Agent", "bisq/" + Version.VERSION); if (headerKey != null && headerValue != null) connection.setRequestProperty(headerKey, headerValue); diff --git a/p2p/src/main/java/bisq/network/p2p/network/Connection.java b/p2p/src/main/java/bisq/network/p2p/network/Connection.java index 86aa7d4fc74..e7e8aeb8ae8 100644 --- a/p2p/src/main/java/bisq/network/p2p/network/Connection.java +++ b/p2p/src/main/java/bisq/network/p2p/network/Connection.java @@ -123,7 +123,7 @@ public enum PeerType { private static final int PERMITTED_MESSAGE_SIZE = 200 * 1024; // 200 kb private static final int MAX_PERMITTED_MESSAGE_SIZE = 10 * 1024 * 1024; // 10 MB (425 offers resulted in about 660 kb, mailbox msg will add more to it) offer has usually 2 kb, mailbox 3kb. //TODO decrease limits again after testing - private static final int SOCKET_TIMEOUT = (int) TimeUnit.SECONDS.toMillis(120); + private static final int SOCKET_TIMEOUT = (int) TimeUnit.SECONDS.toMillis(180); public static int getPermittedMessageSize() { return PERMITTED_MESSAGE_SIZE; diff --git a/p2p/src/main/java/bisq/network/p2p/peers/getdata/GetDataRequestHandler.java b/p2p/src/main/java/bisq/network/p2p/peers/getdata/GetDataRequestHandler.java index bb2c4949f9f..23741347542 100644 --- a/p2p/src/main/java/bisq/network/p2p/peers/getdata/GetDataRequestHandler.java +++ b/p2p/src/main/java/bisq/network/p2p/peers/getdata/GetDataRequestHandler.java @@ -40,7 +40,7 @@ @Slf4j public class GetDataRequestHandler { - private static final long TIMEOUT = 90; + private static final long TIMEOUT = 180; private static final int MAX_ENTRIES = 10000; diff --git a/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/GetPeersRequestHandler.java b/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/GetPeersRequestHandler.java index d9f627f8291..5dcac384d97 100644 --- a/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/GetPeersRequestHandler.java +++ b/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/GetPeersRequestHandler.java @@ -42,7 +42,7 @@ @Slf4j class GetPeersRequestHandler { // We want to keep timeout short here - private static final long TIMEOUT = 40; + private static final long TIMEOUT = 90; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/PeerExchangeHandler.java b/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/PeerExchangeHandler.java index e8d9c08bc0e..9f8fb409b33 100644 --- a/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/PeerExchangeHandler.java +++ b/p2p/src/main/java/bisq/network/p2p/peers/peerexchange/PeerExchangeHandler.java @@ -46,7 +46,7 @@ @Slf4j class PeerExchangeHandler implements MessageListener { // We want to keep timeout short here - private static final long TIMEOUT = 40; + private static final long TIMEOUT = 90; private static final int DELAY_MS = 500;