New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.io.IOException: posix_fallocate() returned 22 on RaspberryPi (Raspbian) #465
Comments
@PestusAtSAG we also see this on our Continuous Integration ARM box. We build and test all Chronicle products on ARM even though it it is not (yet) a supported production platform. The majority of tests pass but a few fail, and this is one of the outstanding issues. |
@JerryShea EINVAL offset was less than 0, or len was less than or equal to I debugged the PosixFallocate class and the offset is equal 0 (not less than 0) and len is bigger than 0 (not equal or less 0). I suppose the filesystem support the operation as well. I can call in the terminal:
and the operation was working on the filesystem. |
https://www.phoronix.com/news/EXT4-No-Delalloc-Perf-Fix maybe delalloc causes the error. |
We found a solution, we are running on a 64 bit arm, instead of using:
we are using now
which is working! It took me a while to find out, a colleage of my gave me the hint, thanks Elias! I can create a PR if you like, however, it is not easy to determine which OS bit version is used from JVM. At least i couldn't find it quickly! We will solve it with a config flag and overload the class net.openhft.chronicle.hash.impl.util.jna.PosixFallocate. |
Thanks for the investigation and comments everyone! Can you try building this version of the Posix library locally to see if it resolves your issue? |
Yes, I tested your PR successfully. When can we expect a fix for the class net.openhft.chronicle.hash.impl.util.jna.PosixFallocate in the ChronicalMap library? Is there a another bugfix release planned for 3.22.X? We decided not to overload your class and wait instead of a fixed version of Chronical-Map. |
@PestusAtSAG this is now fixed in the develop branch (by #466) |
I am running a java application on a RaspberryPi (OS: NAME="Raspbian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)")
Java Version:
openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Raspbian-1deb11u1)
OpenJDK Server VM (build 11.0.16+8-post-Raspbian-1deb11u1, mixed mode)
Using chronicle-map version 3.22.9
I got following exception by creating ChronicleMap (Configuration: averageKeySize: 8, averageValueSize: 4194304, maxBloatFactor: 5.0, entries: 10)
java.io.IOException: posix_fallocate() returned 22
at net.openhft.chronicle.hash.impl.util.jna.PosixFallocate.fallocate(PosixFallocate.java:25)
at net.openhft.chronicle.hash.impl.VanillaChronicleHash.fallocate(VanillaChronicleHash.java:1128)
at net.openhft.chronicle.hash.impl.VanillaChronicleHash.map(VanillaChronicleHash.java:1113)
at net.openhft.chronicle.hash.impl.VanillaChronicleHash.createMappedStoreAndSegments(VanillaChronicleHash.java:515)
at net.openhft.chronicle.map.ChronicleMapBuilder.createWithNewFile(ChronicleMapBuilder.java:1843)
at net.openhft.chronicle.map.ChronicleMapBuilder.createWithFile(ChronicleMapBuilder.java:1741)
at net.openhft.chronicle.map.ChronicleMapBuilder.recoverPersistedTo(ChronicleMapBuilder.java:1622)
at net.openhft.chronicle.map.ChronicleMapBuilder.createOrRecoverPersistedTo(ChronicleMapBuilder.java:1605)
at net.openhft.chronicle.map.ChronicleMapBuilder.createOrRecoverPersistedTo(ChronicleMapBuilder.java:1597)
at net.openhft.chronicle.map.ChronicleMapBuilder.createOrRecoverPersistedTo(ChronicleMapBuilder.java:1591)
There is enough space on the volume (51G free), type ext4:
/dev/root ext4 59G 5,0G 51G 9% /
The applications breaks with this exception but the file is correctly generated! When i restart the application, everything is working fine.
Do you have any idea why posix_fallocate() returns error code 22, even the file is generated and valid?
I added also a ChronicleHashCorruption.Listener to .createOrRecoverPersistedTo
this listener writes to log:
Message: file=/home/opcua-thinedge/opcua/data/deviceTypeMapping.dat: size-prefixed blob readiness bit is set to NOT_COMPLETE
Message: segment headers offset of map at /home/opcua-thinedge/opcua/data/deviceTypeMapping.dat corrupted. stored: 0, should be: 4096
Message: data store size of map at /home/opcua-thinedge/opcua/data/deviceTypeMapping.dat corrupted. stored: 0, should be: 43389504
but this is not true, after the application is stopped, the file is exactly created with the expected size!
The text was updated successfully, but these errors were encountered: