[
https://issues.apache.org/jira/browse/NIFI-4461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16191457#comment-16191457
]
ASF subversion and git services commented on NIFI-4461:
-------------------------------------------------------
Commit 8741b6f6a5fea9815984f1e48dbe723d7948746f in nifi's branch
refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=8741b6f ]
NIFI-4461: When reading from socket channel use blocking mode instead of
sleeping; when writing, use a far smaller sleep duration
This closes #2193.
Signed-off-by: Bryan Bende <[email protected]>
> DistributedMapCacheClient/Server are inefficient when waiting for data to be
> received from socket
> -------------------------------------------------------------------------------------------------
>
> Key: NIFI-4461
> URL: https://issues.apache.org/jira/browse/NIFI-4461
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Reporter: Mark Payne
> Assignee: Mark Payne
> Fix For: 1.5.0
>
>
> The DistributedMapCacheClient and DistributedMapCacheServer use the
> SocketChannelInputStream and SSLSocketChannelInputStream (and output streams)
> for communicating over a socket in non-blocking mode. This is done to allow a
> timeout to occur on a socket write. However, when reading from the socket, it
> ends up calling Thread.sleep(10, TimeUnit.MILLISECONDS) when there is no data
> available, and that can result in extremely slow performance. Instead, we
> should using blocking mode when receiving data because it will throw a
> timeout exception as we desire. When writing, we should continue using
> non-blocking mode but sleep for far less than 10 milliseconds.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)