ARTEMIS-2385 Log header for rejecting message with too large header

Fix test and warning condition to avoid false issues.
This commit is contained in:
brusdev 2019-06-20 16:20:11 +02:00
parent f6e72504ad
commit d14c0de335
2 changed files with 5 additions and 2 deletions

View File

@ -196,8 +196,11 @@ public class AMQPConnectionContext extends ProtonInitializable implements EventH
if (scheduledPool != null && scheduledPool instanceof ThreadPoolExecutor &&
scheduledFuture != null && scheduledFuture instanceof Runnable) {
if (!((ThreadPoolExecutor) scheduledPool).remove((Runnable) scheduledFuture)) {
if (!((ThreadPoolExecutor) scheduledPool).remove((Runnable) scheduledFuture) &&
!scheduledFuture.isCancelled() && !scheduledFuture.isDone()) {
log.warn("Scheduled task can't be removed from scheduledPool.");
} else {
scheduledFuture = null;
}
}
}

View File

@ -81,6 +81,6 @@ public class AMQPConnectionContextTest {
connectionContext.close(null);
Assert.assertEquals(0, scheduledPool.getTaskCount());
Assert.assertEquals(0, scheduledPool.getQueue().size());
}
}