[jira] [Commented] (YARN-505) NPE at AsyncDispatcher$GenericEventHandler
[ https://issues.apache.org/jira/browse/YARN-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14395456#comment-14395456 ] Junping Du commented on YARN-505: - We should never handle null event for AsyncDispatcher, and this is a basic assumption for every call of handle(event) on AsyncDispatcher in YARN. We do have such a practice that: we don't check null if this object is not supposed to be null. If it (become null) do happen in some situations, then we fix these situations because that is not we expect. In this case, NPE is a warn for us that something unexpected happens. I will resolve this JIRA as won't fix. NPE at AsyncDispatcher$GenericEventHandler -- Key: YARN-505 URL: https://issues.apache.org/jira/browse/YARN-505 Project: Hadoop YARN Issue Type: Improvement Components: resourcemanager Affects Versions: 3.0.0 Reporter: Przemyslaw Pretki Priority: Minor Steps to reproduce: {code} @Test public void testAsyncDispatcher() { AsyncDispatcher dispatcher = new AsyncDispatcher(); EventHandler handler = dispatcher.getEventHandler(); handler.handle(null); } {code} Moreover, event taken from *BlockingQueue* will never be *null*, so that it seems that the following condition is not necessary (AsyncDispatcher.createThread() method): {code} if (event != null) { dispatch(event); } {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (YARN-505) NPE at AsyncDispatcher$GenericEventHandler
[ https://issues.apache.org/jira/browse/YARN-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13674208#comment-13674208 ] Niranjan Singh commented on YARN-505: - The NPE is in the LinkedBlockingQueue class of JDK. In handler.handle(null), the event which is null in this case is put in LinkedBlockingQueue , without checking whether the event is null or not. eventQueue.put(event);line 188 of org.apache.hadoop.yarn.event.AsyncDispatcher. One solution could be to check for null when event is put in eventQueue below. if(event != null){ eventQueue.put(event); }else{ LOG.warn(Event cannot be null+event); } NPE at AsyncDispatcher$GenericEventHandler -- Key: YARN-505 URL: https://issues.apache.org/jira/browse/YARN-505 Project: Hadoop YARN Issue Type: Improvement Components: resourcemanager Affects Versions: 3.0.0 Reporter: Przemyslaw Pretki Priority: Minor Steps to reproduce: {code} @Test public void testAsyncDispatcher() { AsyncDispatcher dispatcher = new AsyncDispatcher(); EventHandler handler = dispatcher.getEventHandler(); handler.handle(null); } {code} Moreover, event taken from *BlockingQueue* will never be *null*, so that it seems that the following condition is not necessary (AsyncDispatcher.createThread() method): {code} if (event != null) { dispatch(event); } {code} -- 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