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 {