diff --git a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java index 5b790876c..c64a2eff5 100644 --- a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java +++ b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java @@ -263,7 +263,9 @@ public final class TcpReplicator extends AbstractChannelReplicator impleme LOG.debug("onWrite - " + name); onWrite(key, approxTime); } - } catch (BufferUnderflowException | InterruptedException | IOException | + } catch (InterruptedException e) { + quietClose(key, e); + } catch (BufferUnderflowException | IOException | ClosedSelectorException | CancelledKeyException e) { if (!isClosed) quietClose(key, e); diff --git a/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java b/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java index 6138a3f55..7333e51cb 100644 --- a/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java +++ b/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java @@ -365,24 +365,27 @@ public class CHMUseCasesTest { } @Test - public void testByteArrayArrayValue() throws ExecutionException, InterruptedException, IOException { + public void testByteArrayArrayValue() + throws ExecutionException, InterruptedException, IOException { - int valueSize = 10; + for (int i=0; i < 10000; i++) { + int valueSize = 10; - char[] expected = new char[valueSize]; - Arrays.fill(expected, 'X'); + char[] expected = new char[valueSize]; + Arrays.fill(expected, 'X'); - ChronicleMapBuilder builder = ChronicleMapBuilder - .of(byte[].class, byte[][].class); + ChronicleMapBuilder builder = ChronicleMapBuilder + .of(byte[].class, byte[][].class); - try (ChronicleMap map = newInstance(builder)) { - byte[] bytes1 = "value1".getBytes(); - byte[] bytes2 = "value2".getBytes(); - byte[][] value = {bytes1, bytes2}; - map.put("Key".getBytes(), value); + try (ChronicleMap map = newInstance(builder)) { + byte[] bytes1 = "value1".getBytes(); + byte[] bytes2 = "value2".getBytes(); + byte[][] value = {bytes1, bytes2}; + map.put("Key".getBytes(), value); - assertEquals(value, map.get("Key".getBytes())); - mapChecks(); + assertEquals(value, map.get("Key".getBytes())); + mapChecks(); + } } }