Hi I'm using the following queue versions,
chronicle-queue.version : 4.5.15
chronicle-wire.version : 1.7.14
My Chronicle reader got stuck at some point (index 74204158352345 ) and readDocument returns false after each call, but my chronicle writer was continuing writing messages to the same queue. The reader code is like follows,
ChronicleQueue queue = ChronicleQueueBuilder.single(chroniclePath).build();
excerptTailer = queue.createTailer();
excerptTailer.readDocument(document);// Marshallable document
I'm calling readDocument inside a while loop. There was no chronicle errors in the logs. But my code brakes on the last message from chronicle queue because the message was incomplete. I got only some bytes of the last message and there after readDocument returns false. But there are messages continuously writing to the queue.
My writer code,
public void init() {
queue = ChronicleQueueBuilder.single(chroniclePath).build();
appender = queue.acquireAppender();
}
public void write(T document) {
appender.writeDocument(document);
}
public void destroy() {
if (queue !=null && queue.isClosed()) {
queue.close();
}
}
I tried upgrading the queue to the latest (4.5.27 & 1.7.32
) versions in my local machine and ran the reader on the same production cq4 file(5GB) again I got the same issue but with an error on console (saw the same clues in Thread dump also)
Exception in thread "Chronicle Reader" java.lang.StackOverflowError
at java.lang.ThreadLocal$ThreadLocalMap.getEntry(ThreadLocal.java:414)
at java.lang.ThreadLocal$ThreadLocalMap.access$000(ThreadLocal.java:298)
at java.lang.ThreadLocal.get(ThreadLocal.java:163)
at java.lang.StringCoding.deref(StringCoding.java:63)
at java.lang.StringCoding.encode(StringCoding.java:330)
at java.lang.String.getBytes(String.java:918)
at java.io.UnixFileSystem.checkAccess(Native Method)
at java.io.File.canWrite(File.java:796)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.isReadOnly(SingleChronicleQueueExcerpts.java:798)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.inACycle(SingleChronicleQueueExcerpts.java:1006)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.checkMoveToNextCycle(SingleChronicleQueueExcerpts.java:1055)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.inACycle(SingleChronicleQueueExcerpts.java:1007)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.checkMoveToNextCycle(SingleChronicleQueueExcerpts.java:1055)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.inACycle(SingleChronicleQueueExcerpts.java:1007)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.checkMoveToNextCycle(SingleChronicleQueueExcerpts.java:1055)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.inACycle(SingleChronicleQueueExcerpts.java:1007)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.checkMoveToNextCycle(SingleChronicleQueueExcerpts.java:1055)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.inACycle(SingleChronicleQueueExcerpts.java:1007)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.checkMoveToNextCycle(SingleChronicleQueueExcerpts.java:1055)
etc...
In the new version the readDocument method got hung. May be hung on recursion. What may be the problem, Please help.