Increase timeouts. Rename TIME_OUT to TIMEOUT.

This commit is contained in:
Manfred Karrer 2017-12-17 22:35:09 +01:00
parent 2ca59a819d
commit 7d14975241
No known key found for this signature in database
GPG key ID: 401250966A6B2C46
12 changed files with 20 additions and 19 deletions

View file

@ -186,7 +186,7 @@ public class WalletConfig extends AbstractIdleService {
new InetSocketAddress(socks5Proxy.getInetAddress().getHostName(),
socks5Proxy.getPort()));
int CONNECT_TIMEOUT_MSEC = 60 * 1000; // same value used in bitcoinj.
int CONNECT_TIMEOUT_MSEC = 120 * 1000; // 60 used in bitcoinj, but for Tor we allow more.
ProxySocketFactory proxySocketFactory = new ProxySocketFactory(proxy);
// we dont use tor mode if we have a local node running
BlockingClientManager blockingClientManager = bisqEnvironment.isBitcoinLocalhostNodeRunning() ?

View file

@ -73,7 +73,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
public class WalletsSetup {
private static final Logger log = LoggerFactory.getLogger(WalletsSetup.class);
private static final long STARTUP_TIMEOUT_SEC = 60;
private static final long STARTUP_TIMEOUT_SEC = 120;
private final String btcWalletFileName;
private static final String BSQ_WALLET_FILE_NAME = "bisq_BSQ.wallet";
private static final String SPV_CHAIN_FILE_NAME = "bisq.spvchain";

View file

@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit;
public class GetBlocksRequestHandler {
private static final Logger log = LoggerFactory.getLogger(GetBlocksRequestHandler.class);
private static final long TIME_OUT_SEC = 40;
private static final long TIMEOUT_SEC = 60;
///////////////////////////////////////////////////////////////////////////////////////////
@ -74,7 +74,7 @@ public class GetBlocksRequestHandler {
" on connection:" + connection;
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_TIMEOUT, connection);
},
TIME_OUT_SEC, TimeUnit.SECONDS);
TIMEOUT_SEC, TimeUnit.SECONDS);
}
SettableFuture<Connection> future = networkNode.sendMessage(connection, bsqBlocksResponse);

View file

@ -26,7 +26,7 @@ import static com.google.common.base.Preconditions.checkArgument;
@Slf4j
public class RequestBlocksHandler implements MessageListener {
private static final long TIME_OUT_SEC = 40;
private static final long TIMEOUT_SEC = 60;
///////////////////////////////////////////////////////////////////////////////////////////
@ -95,7 +95,7 @@ public class RequestBlocksHandler implements MessageListener {
"Might be caused by an previous networkNode.sendMessage.onFailure.");
}
},
TIME_OUT_SEC);
TIMEOUT_SEC);
}
log.debug("We send a {} to peer {}. ", getBsqBlocksRequest.getClass().getSimpleName(), peersNodeAddress);

View file

@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
public class OfferAvailabilityProtocol {
private static final Logger log = LoggerFactory.getLogger(OfferAvailabilityProtocol.class);
private static final long TIMEOUT_SEC = 90;
private static final long TIMEOUT_SEC = 120;
private final OfferAvailabilityModel model;
private final ResultHandler resultHandler;

View file

@ -24,6 +24,7 @@ import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
@ -32,7 +33,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
// Run in UserThread
public abstract class NetworkNode implements MessageListener {
private static final Logger log = LoggerFactory.getLogger(NetworkNode.class);
private static final int CREATE_SOCKET_TIMEOUT_MILLIS = 120000;
private static final int CREATE_SOCKET_TIMEOUT_MILLIS = (int) TimeUnit.SECONDS.toMillis(120);
final int servicePort;
private final NetworkProtoResolver networkProtoResolver;

View file

@ -26,7 +26,7 @@ public class BroadcastHandler implements PeerManager.Listener {
///////////////////////////////////////////////////////////////////////////////////////////
private static final Logger log = LoggerFactory.getLogger(BroadcastHandler.class);
private static final long TIMEOUT_PER_PEER_SEC = 30;
private static final long TIMEOUT_PER_PEER_SEC = 60;
interface ResultHandler {
void onCompleted(BroadcastHandler broadcastHandler);

View file

@ -33,7 +33,7 @@ import java.util.stream.Collectors;
public class GetDataRequestHandler {
private static final Logger log = LoggerFactory.getLogger(GetDataRequestHandler.class);
private static final long TIME_OUT_SEC = 60;
private static final long TIMEOUT_SEC = 60;
///////////////////////////////////////////////////////////////////////////////////////////
@ -87,7 +87,7 @@ public class GetDataRequestHandler {
" on connection:" + connection;
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_TIMEOUT, connection);
},
TIME_OUT_SEC, TimeUnit.SECONDS);
TIMEOUT_SEC, TimeUnit.SECONDS);
}
SettableFuture<Connection> future = networkNode.sendMessage(connection, getDataResponse);

View file

@ -37,7 +37,7 @@ import static com.google.common.base.Preconditions.checkArgument;
class RequestDataHandler implements MessageListener {
private static final Logger log = LoggerFactory.getLogger(RequestDataHandler.class);
private static final long TIME_OUT_SEC = 60;
private static final long TIMEOUT_SEC = 60;
private NodeAddress peersNodeAddress;
@ -120,7 +120,7 @@ class RequestDataHandler implements MessageListener {
"Might be caused by an previous networkNode.sendMessage.onFailure.");
}
},
TIME_OUT_SEC);
TIMEOUT_SEC);
}
log.info("We send a {} to peer {}. ", getDataRequest.getClass().getSimpleName(), nodeAddress);

View file

@ -23,7 +23,7 @@ import static com.google.common.base.Preconditions.checkArgument;
class GetPeersRequestHandler {
private static final Logger log = LoggerFactory.getLogger(GetPeersRequestHandler.class);
private static final long TIME_OUT_SEC = 40;
private static final long TIMEOUT_SEC = 60;
///////////////////////////////////////////////////////////////////////////////////////////
@ -83,7 +83,7 @@ class GetPeersRequestHandler {
log.trace("We have stopped already. We ignore that timeoutTimer.run call.");
}
},
TIME_OUT_SEC, TimeUnit.SECONDS);
TIMEOUT_SEC, TimeUnit.SECONDS);
SettableFuture<Connection> future = networkNode.sendMessage(connection,
getPeersResponse);

View file

@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit;
class PeerExchangeHandler implements MessageListener {
private static final Logger log = LoggerFactory.getLogger(PeerExchangeHandler.class);
private static final long TIME_OUT_SEC = 40;
private static final long TIMEOUT_SEC = 60;
private static final int DELAY_MS = 1000;
@ -98,7 +98,7 @@ class PeerExchangeHandler implements MessageListener {
log.trace("We have stopped that handler already. We ignore that timeoutTimer.run call.");
}
},
TIME_OUT_SEC, TimeUnit.SECONDS);
TIMEOUT_SEC, TimeUnit.SECONDS);
}
SettableFuture<Connection> future = networkNode.sendMessage(nodeAddress, getPeersRequest);

View file

@ -30,7 +30,7 @@ import java.util.stream.Collectors;
@Slf4j
class MonitorRequestHandler implements MessageListener {
private static final long TIME_OUT_SEC = 120;
private static final long TIMEOUT_SEC = 120;
private NodeAddress peersNodeAddress;
private long requestTs;
@ -109,7 +109,7 @@ class MonitorRequestHandler implements MessageListener {
"Might be caused by an previous networkNode.sendMessage.onFailure.");
}
},
TIME_OUT_SEC);
TIMEOUT_SEC);
log.info("We send a {} to peer {}. ", getDataRequest.getClass().getSimpleName(), nodeAddress);
networkNode.addMessageListener(this);