Tunnels: Reduce build reply timeout

This commit is contained in:
zzz
2022-03-12 11:37:29 -05:00
parent aa620f5ed3
commit ca0d9f5a26
4 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2022-03-12 zzz
* SSU2: Fixes
* Tunnels: Reduce build reply timeout
2022-03-11 zzz
* i2psnark standalone: Add DTG

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Git";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 6;
public final static long BUILD = 7;
/** for example "-test" */
public final static String EXTRA = "";

View File

@ -20,6 +20,7 @@ import net.i2p.stat.Rate;
import net.i2p.stat.RateStat;
import net.i2p.stat.StatManager;
import net.i2p.util.Log;
import net.i2p.util.SystemVersion;
/**
* Single threaded controller of the tunnel creation process, spanning all tunnel pools.
@ -307,7 +308,7 @@ class BuildExecutor implements Runnable {
*/
/** Set 1.5 * LOOP_TIME < BuildRequestor.REQUEST_TIMEOUT/4 - margin */
private static final int LOOP_TIME = 1000;
private static final int LOOP_TIME = SystemVersion.isSlow() ? 1000 : 800;
public void run() {
_isRunning = true;

View File

@ -32,6 +32,7 @@ import net.i2p.router.tunnel.HopConfig;
import net.i2p.router.tunnel.TunnelCreatorConfig;
import static net.i2p.router.tunnel.pool.BuildExecutor.Result.*;
import net.i2p.util.Log;
import net.i2p.util.SystemVersion;
import net.i2p.util.VersionComparator;
/**
@ -69,7 +70,7 @@ abstract class BuildRequestor {
* so can we use a successfully built tunnel anyway.
*
*/
static final int REQUEST_TIMEOUT = 13*1000;
static final int REQUEST_TIMEOUT = SystemVersion.isSlow() ? 10*1000 : 5*1000;
/** make this shorter than REQUEST_TIMEOUT */
private static final int FIRST_HOP_TIMEOUT = 10*1000;