mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-230 - checking in fixes to the multi threaded stateless client, it now works ( kind of ), unless its put under load, test net.openhft.chronicle.map.StatelessClientTest.testThreadSafeness will gradually slow down - so am still looking into this issue further.
This commit is contained in:
@@ -1179,6 +1179,9 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
// state is used for both heartbeat and stateless
|
||||
state = out.readByte();
|
||||
sizeInBytes = out.readInt();
|
||||
//System.out.println("received size=" + sizeInBytes);
|
||||
// System.out.println("......sizeInBytes=>" + sizeInBytes);
|
||||
assert sizeInBytes > 0;
|
||||
|
||||
// if the buffer is too small to read this payload we will have to grow the
|
||||
// size of the buffer
|
||||
@@ -1200,6 +1203,7 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
}
|
||||
|
||||
final long nextEntryPos = out.position() + sizeInBytes;
|
||||
assert nextEntryPos > 0;
|
||||
final long limit = out.limit();
|
||||
out.limit(nextEntryPos);
|
||||
|
||||
@@ -1522,6 +1526,8 @@ class StatelessServerConnector<K, V> {
|
||||
writeException(writer, e);
|
||||
|
||||
writeSizeAndFlags(sizeLocation + SIZE_OF_TRANSACTION_ID, true, writer);
|
||||
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1866,6 +1872,8 @@ class StatelessServerConnector<K, V> {
|
||||
long pos = out.position();
|
||||
long limit = out.limit();
|
||||
|
||||
// System.out.println("Sending with size=" + size);
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
out.position(locationOfSize);
|
||||
out.limit(pos);
|
||||
|
||||
Reference in New Issue
Block a user