forked from I2P_Developers/i2p.i2p
i2ptunnel: Catch and log uncaught errors in thread pool
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user