Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.1.0
-
None
-
None
Description
Situation:
1. Create a server and client.
2. Fill the server with a large amount of data.
3. Create a query that will result in over 600,000 entries as result.
4. Chunk the result set in such a way that one chunk will result in a size greater than 2GB
5. Execute the query from the client.
Expected:
Message too large exception.
Cause / Fix for the issue:
If the number of parts to be transmitted is one then in sendBytes()
Message.java
for (int i = 0; i < this.numberOfParts; i++) { Part part = this.partsList[i]; headerLen += PART_HEADER_SIZE; totalPartLen += part.getLength(); }
- Here the part.getLength() is an int, so if the size is greater than 2GB we have already overflowed the int barrier and we are putting a negative value in totalPartLen
so when we do the below check :
Message.java
if ((headerLen + totalPartLen) > Integer.MAX_VALUE) { throw new MessageTooLargeException( "Message size (" + (headerLen + totalPartLen) + ") exceeds maximum integer value"); }
The comparison is between a negative number and positive number [Integer.MAX_VALUE] hence it will always skip this loop.
and ultimately result in this exception.
java.io.IOException: Part length ( -508,098,123 ) and number of parts ( 1 ) inconsistent at com.gemstone.gemfire.internal.cache.tier.sockets.Message.readPayloadFields(Message.java:836) at com.gemstone.gemfire.internal.cache.tier.sockets.ChunkedMessage.readChunk(ChunkedMessage.java:276) at com.gemstone.gemfire.internal.cache.tier.sockets.ChunkedMessage.receiveChunk(ChunkedMessage.java:220) at com.gemstone.gemfire.cache.client.internal.ExecuteRegionFunctionOp$ExecuteRegionFunctionOpImpl.processResponse(ExecuteRegionFunctionOp.java:482) at com.gemstone.gemfire.cache.client.internal.AbstractOp.processResponse(AbstractOp.java:215) at com.gemstone.gemfire.cache.client.internal.AbstractOp.attemptReadResponse(AbstractOp.java:153) at com.gemstone.gemfire.cache.client.internal.AbstractOp.attempt(AbstractOp.java:369) at com.gemstone.gemfire.cache.client.internal.ConnectionImpl.execute(ConnectionImpl.java:252) at com.gemstone.gemfire.cache.client.internal.pooling.PooledConnection.execute(PooledConnection.java:319) at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.executeWithPossibleReAuthentication(OpExecutorImpl.java:933) at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.execute(OpExecutorImpl.java:158) at com.gemstone.gemfire.cache.client.internal.PoolImpl.execute(PoolImpl.java:716) at com.gemstone.gemfire.cache.client.internal.ExecuteRegionFunctionOp.execute(ExecuteRegionFunctionOp.java:159) at com.gemstone.gemfire.cache.client.internal.ServerRegionProxy.executeFunction(ServerRegionProxy.java:801) at com.gemstone.gemfire.internal.cache.execute.ServerRegionFunctionExecutor.executeOnServer(ServerRegionFunctionExecutor.java:212) at com.gemstone.gemfire.internal.cache.execute.ServerRegionFunctionExecutor.executeFunction(ServerRegionFunctionExecutor.java:165) at com.gemstone.gemfire.internal.cache.execute.ServerRegionFunctionExecutor.execute(ServerRegionFunctionExecutor.java:363) at com.bookshop.buslogic.TestClient.run(TestClient.java:40) at com.bookshop.buslogic.TestClient.main(TestClient.java:21)