Chronicle-Bytes
Chronicle-Bytes copied to clipboard
mappedBytes: better protection when the disk is full
Currently, if the disk is full, we allow the mapped bytes to be created, then crash the JVM with an hs_err_file if we attempt to access the mapped bytes ( see below which was run on a mount which had a full disk )
Ideally, users should never run the code on a system with a full disk, however, The problem about crashing the JVM is it makes diagnosing what caused the crash rather difficult as it is not immediately obvious that the issue is related to the disk being full.
Stack: [0x00007f394adaf000,0x00007f394aeb0000], sp=0x00007f394aeae4c0, free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xac3677] Unsafe_GetIntVolatile+0x67
j sun.misc.Unsafe.getIntVolatile(Ljava/lang/Object;J)I+0
j net.openhft.chronicle.core.UnsafeMemory.readVolatileInt(J)I+5
j net.openhft.chronicle.bytes.NativeBytesStore.readVolatileInt(J)I+14
j net.openhft.chronicle.bytes.AbstractBytes.readVolatileInt(J)I+14
j software.chronicle.market.data.distributor.ConcurrentReadWriteBuffer.init(Lnet/openhft/chronicle/bytes/Bytes;IJI)V+172
j software.chronicle.market.data.distributor.ConcurrentReadWriteBuffer.<init>(Ljava/io/File;III)V+55
j software.chronicle.market.data.distributor.ConcurrentReadWriteBufferTest$1Writer.run()V+13
j java.lang.Thread.run()V+11
j net.openhft.chronicle.core.threads.CleaningThread.run()V+1
v ~StubRoutines::call_stub
V [libjvm.so+0x67d2a5] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0xc55
V [libjvm.so+0x67aa0f] JavaCalls::call_virtual(JavaValue*, KlassHandle, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x27f
V [libjvm.so+0x67afc7] JavaCalls::call_virtual(JavaValue*, Handle, KlassHandle, Symbol*, Symbol*, Thread*)+0x77
V [libjvm.so+0x6c183f] thread_entry(JavaThread*, Thread*)+0x7f
V [libjvm.so+0xaa5d04] JavaThread::thread_main_inner()+0x214
V [libjvm.so+0xaa60e8] JavaThread::run()+0x3a8
V [libjvm.so+0x8cd662] java_start(Thread*)+0x162
C [libpthread.so.0+0x82de] start_thread+0xfe
Agreed we should have a better accounting of disk usage to prevent this.
@peter-lawrey just pointing you at this as I know that you are working on mapped bytes at the moment.
Any progress on this?
Needs https://github.com/OpenHFT/Chronicle-Threads/issues/71
https://github.com/OpenHFT/Chronicle-Threads/pull/189 will help
Threads implementation covers the same.