mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
fixed an issue, around sending exceptions back to the stateless client from the server
This commit is contained in:
@@ -1832,7 +1832,7 @@ class StatelessServerConnector<K, V> {
|
||||
|
||||
writeException(writer, e);
|
||||
|
||||
writeSizeAndFlags(sizeLocation + SIZE_OF_TRANSACTION_ID, true, writer.in());
|
||||
writeSizeAndFlags(sizeLocation , true, writer.in());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -205,6 +205,36 @@ public class StatelessClientTest {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* test that when the map is full and exception is thrown back to the user
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test(timeout = 10000, expected = IllegalStateException.class)
|
||||
public void testExceptionFromServer() throws IOException, InterruptedException {
|
||||
int port = s_port++;
|
||||
|
||||
final int size = 100;
|
||||
|
||||
try (ChronicleMap<Integer, CharSequence> serverMap = ChronicleMapBuilder
|
||||
.of(Integer.class, CharSequence.class)
|
||||
.entries(10)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(port))
|
||||
.create()) {
|
||||
try (ChronicleMap<Integer, CharSequence> statelessMap = localClient(port)) {
|
||||
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
statelessMap.put(i, "hello");
|
||||
}
|
||||
|
||||
assertEquals(statelessMap.size(), size);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBufferOverFlowPutAllAndKeySet() throws IOException, InterruptedException {
|
||||
int port = 10 + s_port++;
|
||||
|
||||
Reference in New Issue
Block a user