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

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

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

NIFI-7566: Avoid using Thread.sleep() to wait for Site-to-Site connection to be 
handled. Instead, use TimeUnit.timedWait and use Object.notifyAll when setting 
the beingServiced flag. This significantly reduces latency and improves 
throughput for small-batch site-to-site communications

This closes #4353.

Signed-off-by: Andy LoPresto <[email protected]>


> Site-to-Site uses Thread.sleep() to wait for background thread to complete 
> its job. It shouldn't.
> -------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-7566
>                 URL: https://issues.apache.org/jira/browse/NIFI-7566
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently, the StandardPublicPort sits in a loop, calling 
> `Thread.sleep(100L);` while it waits for a background thread to complete its 
> job. This can add huge latency to the process of servicing a Site-to-Site 
> request/connection. Instead, it should use `Object.wait(100);` or similar and 
> be notified when the other thread completes its task.



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

Reply via email to