i2ptunnel: Catch and log uncaught errors in thread pool

This commit is contained in:
zzz
2015-04-21 20:37:59 +00:00
parent fdada78edf
commit 212f6b472a
4 changed files with 32 additions and 4 deletions

View File

@@ -752,10 +752,17 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
* Blocking runner, used during the connection establishment
*/
private class BlockingRunner implements Runnable {
private Socket _s;
private final Socket _s;
public BlockingRunner(Socket s) { _s = s; }
public void run() {
clientConnectionRun(_s);
try {
clientConnectionRun(_s);
} catch (Throwable t) {
// probably an IllegalArgumentException from
// connecting to the router in a delay-open or
// close-on-idle tunnel (in connectManager() above)
_log.error("Uncaught error in i2ptunnel client", t);
}
}
}

View File

@@ -570,7 +570,11 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
}
public void run() {
blockingHandle(_i2ps);
try {
blockingHandle(_i2ps);
} catch (Throwable t) {
_log.error("Uncaught error in i2ptunnel server", t);
}
}
}