mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-06 18:35:19 +00:00
THRIFT-2551 OutOfMemoryError "unable to create new native thread" kills serve thread
Github Pull Request: This closes #112 Patch: Fuud
This commit is contained in:
parent
72268b78a3
commit
80a44f84fb
10
lib/java/src/org/apache/thrift/server/TThreadPoolServer.java
Normal file → Executable file
10
lib/java/src/org/apache/thrift/server/TThreadPoolServer.java
Normal file → Executable file
@ -139,6 +139,16 @@ public class TThreadPoolServer extends TServer {
|
||||
Thread.currentThread().interrupt();
|
||||
break;
|
||||
}
|
||||
} catch(OutOfMemoryError ex) {
|
||||
LOGGER.warn("ExecutorService throws OutOfMemoryError "+ ex.getMessage() + (++rejections) +
|
||||
" times(s)", ex);
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(1);
|
||||
} catch (InterruptedException e) {
|
||||
LOGGER.warn("Interrupted while waiting to place client on executor queue.");
|
||||
Thread.currentThread().interrupt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TTransportException ttx) {
|
||||
|
Loading…
Reference in New Issue
Block a user