[
https://issues.apache.org/jira/browse/ZOOKEEPER-1375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13765965#comment-13765965
]
Keith Turner commented on ZOOKEEPER-1375:
-----------------------------------------
In ACCUMULO-1708, I am trying to work out a way to make Accumulo server
processes die if any thread throws an Error. Accumulo uses Zookeeper and HDFS.
One problem I have run into is that zookeeper and HDFS create threads that
could possibly throw OOME. I thought I was onto something with
ThreadGroup.uncaughtException(), but since zookeeper and hdfs threads catch
Throwable its a dead end. If interested, I attached an example called
ThreadTest.java to ACCUMULO-1708 that shows an experiment trying to use a
thread group.
If zookeeper client side threads always rethrew Errors, then this would ideal
for my purposes. Zookeeper code could still try to take some action in catch.
I suppose this might look like the following.
{code:java}
try{
//...
} catch (Throwable e)
{
try{
//..
cleanup();
if(state.isAlive()){
eventThread.queueEvent(
new WatchedEvent(Event.EventType.None, Event.KeeperState.Disconnected,
null) )
}
//....
}catch (Throwable e) {
//failure while trying to process failure
e.printStackTrace();
}finally{
throw e;
}
}
{code}
> SendThread is exiting after OOMError
> ------------------------------------
>
> Key: ZOOKEEPER-1375
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1375
> Project: ZooKeeper
> Issue Type: Bug
> Affects Versions: 3.4.0
> Reporter: Rakesh R
>
> After reviewing the ClientCnxn code, there is still chances of exiting the
> SendThread without intimating the users. Say if client throws OOMError and
> entered into the throwable block. Here again while sending the Disconnected
> event, its creating "new WatchedEvent()" object.This will throw OOMError and
> leads to exit the SendThread without any Disconnected event notification.
> {noformat}
> try{
> //...
> } catch (Throwable e)
> {
> //..
> cleanup();
> if(state.isAlive()){
> eventThread.queueEvent(
> new WatchedEvent(Event.EventType.None,
> Event.KeeperState.Disconnected, null) )
> }
> //....
> }
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira