您好我使用以下队列版本
chronicle-queue.version : 4.5.15
chronicle-wire.version : 1.7.14
My Chronicle读者在某些时候陷入困境(索引74204158352345),readDocument在每次调用后返回false,但我的编年史编写者继续将消息写入同一队列。 读者代码如下,
ChronicleQueue queue = ChronicleQueueBuilder.single(chroniclePath).build();
excerptTailer = queue.createTailer();
excerptTailer.readDocument(document);// Marshallable document
我在while循环中调用readDocument。 日志中没有编年史错误。但是我的代码会对编年史队列中的最后一条消息进行制动,因为消息不完整。我只获得了最后一条消息的一些字节,并且在readDocument之后返回false。但是有消息不断写入队列。
我的作家代码,
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();
}
}
我尝试将队列升级到本地计算机中的最新版本(4.5.27 & 1.7.32
)并再次在同一个生产cq4文件(5GB)上运行读取器我遇到了同样的问题,但在控制台上出现错误(锯螺纹转储中的相同线索也是如此)
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...
在新版本中,readDocument方法挂起。可能挂在递归上。 可能是什么问题,请帮忙。