From 7423b41e3cfbace8a01ca9734521ae49117dbba8 Mon Sep 17 00:00:00 2001 From: Koji Kawamura Date: Mon, 11 Sep 2017 18:45:11 +0900 Subject: [PATCH] NIFI-4376: Remove expired S2S request from internal queue. This closes #2144. Before this fix, expired requests stay in the queue and blocks newly received requests to be offerred. --- .../java/org/apache/nifi/remote/StandardRootGroupPort.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRootGroupPort.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRootGroupPort.java index ea79675acc..ee16406841 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRootGroupPort.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRootGroupPort.java @@ -518,6 +518,8 @@ public class StandardRootGroupPort extends AbstractPort implements RootGroupPort // before the request expires while (!request.isBeingServiced()) { if (request.isExpired()) { + // Remove expired request, so that it won't block new request to be offered. + this.requestQueue.remove(request); throw new SocketTimeoutException("Read timed out"); } else { try { @@ -572,6 +574,8 @@ public class StandardRootGroupPort extends AbstractPort implements RootGroupPort // before the request expires while (!request.isBeingServiced()) { if (request.isExpired()) { + // Remove expired request, so that it won't block new request to be offered. + this.requestQueue.remove(request); throw new SocketTimeoutException("Read timed out"); } else { try {