[ 
https://issues.apache.org/jira/browse/NIFI-1436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15115390#comment-15115390
 ] 

ASF GitHub Bot commented on NIFI-1436:
--------------------------------------

GitHub user bbende opened a pull request:

    https://github.com/apache/nifi/pull/189

    NIFI-1436 Fixing race condition in SocketChannelDispatcher 

    From looking at the test failure that was reported, it was a 
ConcurrentModificationException in the close() method of 
SocketChannelDispatcher, which happens when looping over selector.keys().
    
    When the processor is unscheduled it calls stop() then close(). The stop 
method sets a stopped flag that the run method uses as an exit condition, and 
then calls selector.wakeup(). It appears that it would be possible for the run 
method to have not fully finished before close() is called, making it possible 
for the selector's keys to get modified while close() is happening.
    
    I was never able to produce the test failure locally, so if someone who 
encountered it could test this change it would be helpful.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bbende/nifi NIFI-1436

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/189.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #189
    
----
commit a114f582d4578d64d984628567a1d7b6767b4fc5
Author: Bryan Bende <[email protected]>
Date:   2016-01-25T14:44:24Z

    NIFI-1436 Fixing race condition in SocketChannelDispatcher where close() 
could be called before run() is fully done

----


> Intermittent Failure of TestListenSyslog
> ----------------------------------------
>
>                 Key: NIFI-1436
>                 URL: https://issues.apache.org/jira/browse/NIFI-1436
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Bryan Bende
>            Assignee: Bryan Bende
>            Priority: Minor
>             Fix For: 0.5.0
>
>
> Tests run: 8, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.165 sec <<< 
> FAILURE! - in org.apache.nifi.processors.standard.TestListenSyslog
> testTCPSingleConnection(org.apache.nifi.processors.standard.TestListenSyslog) 
>  Time elapsed: 0.716 sec  <<< ERROR!
> java.util.ConcurrentModificationException: null
>       at java.util.HashMap$HashIterator.nextNode(HashMap.java:1429)
>       at java.util.HashMap$KeyIterator.next(HashMap.java:1453)
>       at 
> java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1042)
>       at 
> org.apache.nifi.processor.util.listen.dispatcher.SocketChannelDispatcher.close(SocketChannelDispatcher.java:219)
>       at 
> org.apache.nifi.processors.standard.ListenSyslog.onUnscheduled(ListenSyslog.java:313)
>       at 
> org.apache.nifi.processors.standard.TestListenSyslog.testTCPSingleConnection(TestListenSyslog.java:166)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to