[ https://issues.apache.org/jira/browse/ZOOKEEPER-1375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13749865#comment-13749865 ]
Vinay commented on ZOOKEEPER-1375: ---------------------------------- As rakesh told [here|https://issues.apache.org/jira/browse/ZOOKEEPER-1100?focusedCommentId=13234068&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13234068], throwable was handled in catch block, but there is a chance of getting OOME while creating event. we got this specific OOME and SendThread exited and clients hanged. {noformat}2013-08-25 23:02:41,206 - ERROR [main-SendThread(linux-136:25500):ClientCnxn$1@411] - from main-SendThread(linux-136:25500) java.lang.OutOfMemoryError: Java heap space at java.util.HashMap.resize(HashMap.java:462) at java.util.HashMap.addEntry(HashMap.java:755) at java.util.HashMap.put(HashMap.java:385) at java.util.HashSet.add(HashSet.java:200) at java.util.AbstractCollection.addAll(AbstractCollection.java:305) at org.apache.zookeeper.ZooKeeper$ZKWatchManager.materialize(ZooKeeper.java:183) at org.apache.zookeeper.ClientCnxn$EventThread.queueEvent(ClientCnxn.java:463) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1123){noformat} So, we need better handling of OOME. Any thoughts? > 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