Skip to content
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

Absorb missing (or not functioning) fallocate64. #34

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

rogersimmons
Copy link
Contributor

Fixes Issue 31

…h unavailable

ftruncate is more widely supported, and while not a strict replacement is close enough for most cases
@rogersimmons rogersimmons merged commit bfaa7af into develop Jun 4, 2024
8 of 9 checks passed
@splunk-chowiel
Copy link

@rogersimmons Thanks for the change. I was trying this out on Alpine Linux 3.19+ 64-bit and it seems that an UnsatisfiedLinkError is thrown when calling fallocate64 (which no longer is present on Alpine 3.19+ 64-bit).

I did notice the new changes catch Exception when attempting to invoke fallocate(64) functions, but perhaps this does not handle UnsatisfiedLinkError and fallback as expected to fallocate?

java.lang.UnsatisfiedLinkError: Symbol not found: Java_com_kenai_jffi_Foreign_dlerror
	at jnr.ffi.provider.jffi.AsmRuntime.newUnsatisifiedLinkError(AsmRuntime.java:48)
	at net.openhft.posix.internal.jnr.JNRPosixInterface$jnr$ffi$0.fallocate64(Unknown Source)
	at net.openhft.posix.internal.jnr.JNRPosixAPI.fallocate(JNRPosixAPI.java:244)
	at net.openhft.chronicle.hash.impl.util.jna.PosixFallocate.fallocate(PosixFallocate.java:18)
	at net.openhft.chronicle.hash.impl.VanillaChronicleHash.fallocate(VanillaChronicleHash.java:1109)
	at net.openhft.chronicle.hash.impl.VanillaChronicleHash.map(VanillaChronicleHash.java:1095)
	at net.openhft.chronicle.hash.impl.VanillaChronicleHash.createMappedStoreAndSegments(VanillaChronicleHash.java:516)
	at net.openhft.chronicle.map.ChronicleMapBuilder.createWithNewFile(ChronicleMapBuilder.java:1824)
	at net.openhft.chronicle.map.ChronicleMapBuilder.createWithFile(ChronicleMapBuilder.java:1722)
	at net.openhft.chronicle.map.ChronicleMapBuilder.createPersistedTo(ChronicleMapBuilder.java:1585)

@rogersimmons
Copy link
Contributor Author

rogersimmons commented Jul 2, 2024

Thank you @splunk-chowiel.
Fix pending in #39

@rogersimmons
Copy link
Contributor Author

@splunk-chowiel - for info, the fix for the UnsatisfiedLinkError is now available in release https://github.com/OpenHFT/Posix/releases/tag/posix-2.26ea2

tgd pushed a commit that referenced this pull request Nov 6, 2024
* Absorb missing (or not functioning) fallocate64.
Fixes Issue 31

* Revert to ftruncate when possible in cases where fallocate/64 are both unavailable
ftruncate is more widely supported, and while not a strict replacement is close enough for most cases

---------

Co-authored-by: rogersimmons <roger.simmons@higherfrequencytrading.com>
tgd added a commit that referenced this pull request Nov 6, 2024
* Absorb missing (or not functioning) fallocate64. (#34)

* Absorb missing (or not functioning) fallocate64.
Fixes Issue 31

* Revert to ftruncate when possible in cases where fallocate/64 are both unavailable
ftruncate is more widely supported, and while not a strict replacement is close enough for most cases

---------

Co-authored-by: rogersimmons <roger.simmons@higherfrequencytrading.com>

* Extend exception/error handling on speculative fallocate64 calls etc (#39)

Co-authored-by: rogersimmons <roger.simmons@higherfrequencytrading.com>

* More graceful, slightly safer failback if fallocate not supported (#40)

Co-authored-by: rogersimmons <roger.simmons@higherfrequencytrading.com>

---------

Co-authored-by: rogersimmons <42873823+rogersimmons@users.noreply.github.com>
Co-authored-by: rogersimmons <roger.simmons@higherfrequencytrading.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants