[jira] [Commented] (NIFI-5952) RAW Site-to-Site fails with java.nio.channels.IllegalBlockingModeException

2020-02-06 Thread Ryan Hendrickson (Jira)


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

Ryan Hendrickson commented on NIFI-5952:


[~mosermw] agree - Discussion on this topic after 'fix'.  
[https://www.mail-archive.com/dev@nifi.apache.org/msg17898.html]

> RAW Site-to-Site fails with java.nio.channels.IllegalBlockingModeException
> --
>
> Key: NIFI-5952
> URL: https://issues.apache.org/jira/browse/NIFI-5952
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
> Environment: jdk-11.0.1
>Reporter: Koji Kawamura
>Assignee: Koji Kawamura
>Priority: Blocker
>  Labels: Java11
> Fix For: 1.10.0
>
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> During the review cycle of NIFI-5820, I found that while HTTP S2S works 
> without issue, RAW S2S is failing with following Exception:
> {code:java}
>  2018-12-19 16:19:26,811 ERROR [Site-to-Site Listener] org.apache.nifi.NiFi
>  java.nio.channels.IllegalBlockingModeException: null
>  at 
> java.base/sun.nio.ch.ServerSocketAdaptor.accept(ServerSocketAdaptor.java:121)
>  at 
> org.apache.nifi.remote.SocketRemoteSiteListener$1.run(SocketRemoteSiteListener.java:125)
>  at java.base/java.lang.Thread.run(Thread.java:834)
> {code}
> Despite of the fact that the RAW has been worked with older Java versions, it 
> seems current nio usage at RAW S2S is not correct. And JDK 11 starts 
> complaining about it.
> Here are few things I've discovered with current NiFi and nio SocketChannel:
>  - NiFi accepts RAW S2S client connection with SocketRemoteSiteListener, 
> which uses ServerSocketChannel as non-blocking manner [1]
>  - But SocketRemoteSiteListener doesn't use Selector API to accept incoming 
> connection and transfer data with the channel. This is the cause of above 
> exception.
>  - SocketRemoteSiteListener spawns new thread when it accepts connection. 
> This is how connections are handled with a non-nio, standard Socket 
> programming. If we want to use non-blocking NIO, we need to use channels with 
> Selector
>  - But using non-blocking IO with current NiFi S2S protocol can only add few 
> or none benefit by doing so. [2]
> To make RAW S2S work with Java 11, we need either:
>  A. Stop using nio packages.
>  B. Implement correct nio usage, meaning use Selector IO and probably we need 
> another thread pool.
> I'm going to take the approach A above, because B would take much more 
> refactoring.
> [1] 
> [https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/SocketRemoteSiteListener.java#L120]
>  [2] 
> [https://stackoverflow.com/questions/12338204/in-java-nio-is-a-selector-useful-for-a-client-socketchannel]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (NIFI-5952) RAW Site-to-Site fails with java.nio.channels.IllegalBlockingModeException

2020-02-04 Thread Michael W Moser (Jira)


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

Michael W Moser commented on NIFI-5952:
---

Apparently OpenJDK 8u242 (1.8.0_242) can also cause this.

> RAW Site-to-Site fails with java.nio.channels.IllegalBlockingModeException
> --
>
> Key: NIFI-5952
> URL: https://issues.apache.org/jira/browse/NIFI-5952
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
> Environment: jdk-11.0.1
>Reporter: Koji Kawamura
>Assignee: Koji Kawamura
>Priority: Blocker
>  Labels: Java11
> Fix For: 1.10.0
>
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> During the review cycle of NIFI-5820, I found that while HTTP S2S works 
> without issue, RAW S2S is failing with following Exception:
> {code:java}
>  2018-12-19 16:19:26,811 ERROR [Site-to-Site Listener] org.apache.nifi.NiFi
>  java.nio.channels.IllegalBlockingModeException: null
>  at 
> java.base/sun.nio.ch.ServerSocketAdaptor.accept(ServerSocketAdaptor.java:121)
>  at 
> org.apache.nifi.remote.SocketRemoteSiteListener$1.run(SocketRemoteSiteListener.java:125)
>  at java.base/java.lang.Thread.run(Thread.java:834)
> {code}
> Despite of the fact that the RAW has been worked with older Java versions, it 
> seems current nio usage at RAW S2S is not correct. And JDK 11 starts 
> complaining about it.
> Here are few things I've discovered with current NiFi and nio SocketChannel:
>  - NiFi accepts RAW S2S client connection with SocketRemoteSiteListener, 
> which uses ServerSocketChannel as non-blocking manner [1]
>  - But SocketRemoteSiteListener doesn't use Selector API to accept incoming 
> connection and transfer data with the channel. This is the cause of above 
> exception.
>  - SocketRemoteSiteListener spawns new thread when it accepts connection. 
> This is how connections are handled with a non-nio, standard Socket 
> programming. If we want to use non-blocking NIO, we need to use channels with 
> Selector
>  - But using non-blocking IO with current NiFi S2S protocol can only add few 
> or none benefit by doing so. [2]
> To make RAW S2S work with Java 11, we need either:
>  A. Stop using nio packages.
>  B. Implement correct nio usage, meaning use Selector IO and probably we need 
> another thread pool.
> I'm going to take the approach A above, because B would take much more 
> refactoring.
> [1] 
> [https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/SocketRemoteSiteListener.java#L120]
>  [2] 
> [https://stackoverflow.com/questions/12338204/in-java-nio-is-a-selector-useful-for-a-client-socketchannel]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (NIFI-5952) RAW Site-to-Site fails with java.nio.channels.IllegalBlockingModeException

2019-09-13 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on NIFI-5952:
---

Commit 70c428f0970e1c79c14532169a727db85cb1bd66 in nifi's branch 
refs/heads/master from Mark Payne
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=70c428f ]

NIFI-5952: This closes #3265


> RAW Site-to-Site fails with java.nio.channels.IllegalBlockingModeException
> --
>
> Key: NIFI-5952
> URL: https://issues.apache.org/jira/browse/NIFI-5952
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
> Environment: jdk-11.0.1
>Reporter: Koji Kawamura
>Assignee: Koji Kawamura
>Priority: Blocker
>  Labels: Java11
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> During the review cycle of NIFI-5820, I found that while HTTP S2S works 
> without issue, RAW S2S is failing with following Exception:
> {code:java}
>  2018-12-19 16:19:26,811 ERROR [Site-to-Site Listener] org.apache.nifi.NiFi
>  java.nio.channels.IllegalBlockingModeException: null
>  at 
> java.base/sun.nio.ch.ServerSocketAdaptor.accept(ServerSocketAdaptor.java:121)
>  at 
> org.apache.nifi.remote.SocketRemoteSiteListener$1.run(SocketRemoteSiteListener.java:125)
>  at java.base/java.lang.Thread.run(Thread.java:834)
> {code}
> Despite of the fact that the RAW has been worked with older Java versions, it 
> seems current nio usage at RAW S2S is not correct. And JDK 11 starts 
> complaining about it.
> Here are few things I've discovered with current NiFi and nio SocketChannel:
>  - NiFi accepts RAW S2S client connection with SocketRemoteSiteListener, 
> which uses ServerSocketChannel as non-blocking manner [1]
>  - But SocketRemoteSiteListener doesn't use Selector API to accept incoming 
> connection and transfer data with the channel. This is the cause of above 
> exception.
>  - SocketRemoteSiteListener spawns new thread when it accepts connection. 
> This is how connections are handled with a non-nio, standard Socket 
> programming. If we want to use non-blocking NIO, we need to use channels with 
> Selector
>  - But using non-blocking IO with current NiFi S2S protocol can only add few 
> or none benefit by doing so. [2]
> To make RAW S2S work with Java 11, we need either:
>  A. Stop using nio packages.
>  B. Implement correct nio usage, meaning use Selector IO and probably we need 
> another thread pool.
> I'm going to take the approach A above, because B would take much more 
> refactoring.
> [1] 
> [https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/SocketRemoteSiteListener.java#L120]
>  [2] 
> [https://stackoverflow.com/questions/12338204/in-java-nio-is-a-selector-useful-for-a-client-socketchannel]



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (NIFI-5952) RAW Site-to-Site fails with java.nio.channels.IllegalBlockingModeException

2019-09-13 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on NIFI-5952:
---

Commit e659e3b606cc3e41816081046f07d9a8d33c88f6 in nifi's branch 
refs/heads/master from Koji Kawamura
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=e659e3b ]

NIFI-5952 Refactor RAW S2S from nio to socket


> RAW Site-to-Site fails with java.nio.channels.IllegalBlockingModeException
> --
>
> Key: NIFI-5952
> URL: https://issues.apache.org/jira/browse/NIFI-5952
> Project: Apache NiFi
>  Issue Type: Sub-task
>  Components: Core Framework
> Environment: jdk-11.0.1
>Reporter: Koji Kawamura
>Assignee: Koji Kawamura
>Priority: Blocker
>  Labels: Java11
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> During the review cycle of NIFI-5820, I found that while HTTP S2S works 
> without issue, RAW S2S is failing with following Exception:
> {code:java}
>  2018-12-19 16:19:26,811 ERROR [Site-to-Site Listener] org.apache.nifi.NiFi
>  java.nio.channels.IllegalBlockingModeException: null
>  at 
> java.base/sun.nio.ch.ServerSocketAdaptor.accept(ServerSocketAdaptor.java:121)
>  at 
> org.apache.nifi.remote.SocketRemoteSiteListener$1.run(SocketRemoteSiteListener.java:125)
>  at java.base/java.lang.Thread.run(Thread.java:834)
> {code}
> Despite of the fact that the RAW has been worked with older Java versions, it 
> seems current nio usage at RAW S2S is not correct. And JDK 11 starts 
> complaining about it.
> Here are few things I've discovered with current NiFi and nio SocketChannel:
>  - NiFi accepts RAW S2S client connection with SocketRemoteSiteListener, 
> which uses ServerSocketChannel as non-blocking manner [1]
>  - But SocketRemoteSiteListener doesn't use Selector API to accept incoming 
> connection and transfer data with the channel. This is the cause of above 
> exception.
>  - SocketRemoteSiteListener spawns new thread when it accepts connection. 
> This is how connections are handled with a non-nio, standard Socket 
> programming. If we want to use non-blocking NIO, we need to use channels with 
> Selector
>  - But using non-blocking IO with current NiFi S2S protocol can only add few 
> or none benefit by doing so. [2]
> To make RAW S2S work with Java 11, we need either:
>  A. Stop using nio packages.
>  B. Implement correct nio usage, meaning use Selector IO and probably we need 
> another thread pool.
> I'm going to take the approach A above, because B would take much more 
> refactoring.
> [1] 
> [https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/SocketRemoteSiteListener.java#L120]
>  [2] 
> [https://stackoverflow.com/questions/12338204/in-java-nio-is-a-selector-useful-for-a-client-socketchannel]



--
This message was sent by Atlassian Jira
(v8.3.2#803003)