[NO ISSUE][NET] Log Channel Info When Buffers Are Exceeded

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- When the read buffers of a network channel are
  exceeded, log the channel information and throw
  an illegal state exception.

Change-Id: I5290947f57c91d4a537330eef91cf23d9352f24c
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2917
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Reviewed-by: Michael Blow <mblow@apache.org>
diff --git a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java
index 432382a..049cfd8 100644
--- a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java
+++ b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java
@@ -27,9 +27,12 @@
 import org.apache.hyracks.api.comm.IBufferFactory;
 import org.apache.hyracks.api.comm.IChannelControlBlock;
 import org.apache.hyracks.api.exceptions.NetException;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class FullFrameChannelReadInterface extends AbstractChannelReadInterface {
 
+    private static final Logger LOGGER = LogManager.getLogger();
     private final Deque<ByteBuffer> riEmptyStack;
     private final IChannelControlBlock ccb;
 
@@ -64,6 +67,12 @@
                     currentReadBuffer = bufferFactory.createBuffer();
                 }
             }
+            if (currentReadBuffer == null) {
+                if (LOGGER.isWarnEnabled()) {
+                    LOGGER.warn("{} read buffers exceeded. Current empty buffers: {}", ccb, riEmptyStack.size());
+                }
+                throw new IllegalStateException(ccb + " read buffers exceeded");
+            }
             int rSize = Math.min(size, currentReadBuffer.remaining());
             if (rSize > 0) {
                 currentReadBuffer.limit(currentReadBuffer.position() + rSize);