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.
This commit is contained in:
Koji Kawamura 2017-09-11 18:45:11 +09:00 committed by Mark Payne
parent d698f227df
commit 7423b41e3c
1 changed files with 4 additions and 0 deletions

View File

@ -518,6 +518,8 @@ public class StandardRootGroupPort extends AbstractPort implements RootGroupPort
// before the request expires // before the request expires
while (!request.isBeingServiced()) { while (!request.isBeingServiced()) {
if (request.isExpired()) { 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"); throw new SocketTimeoutException("Read timed out");
} else { } else {
try { try {
@ -572,6 +574,8 @@ public class StandardRootGroupPort extends AbstractPort implements RootGroupPort
// before the request expires // before the request expires
while (!request.isBeingServiced()) { while (!request.isBeingServiced()) {
if (request.isExpired()) { 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"); throw new SocketTimeoutException("Read timed out");
} else { } else {
try { try {