mirror of https://github.com/apache/nifi.git
NIFI-2268: Instead of allowing HandleHttpRequest to run constantly calling BlockingQueue.poll() as fast as possible, call BlockingQueue.poll(2, TimeUnit.MILLISECONDS) to avoid overutilization of CPU when there is no work to be done
This closes #1762. Signed-off-by: Bryan Bende <bbende@apache.org>
This commit is contained in:
parent
e6be5d3276
commit
12249e5a08
|
@ -484,7 +484,14 @@ public class HandleHttpRequest extends AbstractProcessor {
|
|||
throw new ProcessException("Failed to initialize the server",e);
|
||||
}
|
||||
|
||||
final HttpRequestContainer container = containerQueue.poll();
|
||||
HttpRequestContainer container;
|
||||
try {
|
||||
container = containerQueue.poll(2, TimeUnit.MILLISECONDS);
|
||||
} catch (final InterruptedException e1) {
|
||||
Thread.currentThread().interrupt();
|
||||
return;
|
||||
}
|
||||
|
||||
if (container == null) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue