Skip to content

Conversation

@GeorgeAp
Copy link

@GeorgeAp GeorgeAp commented Jan 6, 2026

What's Changed

Upgrade Arrow Java to 18.3..0

Change logs from Arrow 16.0.0 to Arrow Java 18.3.0
Arrow 16.0.0 - https://arrow.apache.org/blog/2024/04/20/16.0.0-release/
Arrow 17.0.0 - https://arrow.apache.org/blog/2024/07/16/17.0.0-release/
Arrow 18.0.0 - https://arrow.apache.org/blog/2024/10/28/18.0.0-release/
Arrow-Java 18.2.0 to 18.3.0 - https://github.com/apache/arrow-java/releases

Please fill in a description of the changes here.

This contains breaking changes.

Closes https://sirensolutions.atlassian.net/browse/FEDE-8281

Comment on lines 106 to 109
} catch (NoSuchMethodException e) {
logger.debug("Cannot get constructor for direct buffer allocation", e);
return e;
} catch (SecurityException e) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@torito this change was due to the [2021-11-24T15:22:37,545][DEBUG][s.i.n.u.i.PlatformDependent0] [mars] direct buffer constructor: unavailable reported in the PR sirensolutions/arrow#17.
The issue was widely discussed in google/gson#1875 and google/gson#1902

Copy link
Author

@GeorgeAp GeorgeAp Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the exception thrown if we revert our change

java.lang.NoClassDefFoundError: Could not initialize class org.apache.arrow.memory.RootAllocator

	at __randomizedtesting.SeedInfo.seed([9E683B735110AFF2:76856F24D3CDD0A6]:0)
	... federate calls
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread "SUITE-UTFHelperTest-seed#[DF6017972AC13922]-worker"]
	at org.apache.arrow.memory.unsafe.UnsafeAllocationManager.<clinit>(UnsafeAllocationManager.java:29)
	at org.apache.arrow.memory.unsafe.DefaultAllocationManagerFactory.<clinit>(DefaultAllocationManagerFactory.java:26)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:421)
	at java.base/java.lang.Class.forName(Class.java:412)
	at org.apache.arrow.memory.DefaultAllocationManagerOption.getFactory(DefaultAllocationManagerOption.java:105)
	at org.apache.arrow.memory.DefaultAllocationManagerOption.getDefaultAllocationManagerFactory(DefaultAllocationManagerOption.java:92)
	at org.apache.arrow.memory.BaseAllocator$Config.getAllocationManagerFactory(BaseAllocator.java:826)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those discussions on gson are not entirelly related, can you please:

  • instead of generic catch(Exception e), add a new catch (RealReceivedException e) {...} // <-- this to propose an upstream fix
  • Explain why if the exception is thrown, federate still works ? Direct Buffer is not needed for us ? what do we use instead ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The real exception is not InaccessibleObjectException ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is actually that

java.lang.reflect.InaccessibleObjectException: Unable to make private java.nio.DirectByteBuffer(long,long) accessible: module java.base does not "opens java.nio" to unnamed module @2d6e8792

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add only a new catch for InaccessibleObjectException instead of a generic one

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont replace, add a new catch entry

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted our change and added it in-place of the SecurityException d6fca40, wdyt?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the SecurityException back

@GeorgeAp GeorgeAp marked this pull request as ready for review January 8, 2026 09:00
@GeorgeAp GeorgeAp requested review from scampi and torito February 3, 2026 14:48

/** The unsafe object from which to access the off-heap memory. */
private static final Unsafe UNSAFE;
public static final Unsafe UNSAFE;
Copy link

@torito torito Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need those to be public ?, where we are accessing it in Federate ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We access it in Federate and keeping it private breaks our usage

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In federate we are already accessing the Unsafe, see https://github.com/sirensolutions/siren-platform/blob/f32ca909badbf0527ffe90231fa5b52ee36a3d35/core/src/main/java/io/siren/federate/core/common/ReflectionHelper.java#L129
So, instead of geting the Unsafe from MemoryUtil, we access it by using the one we get from the ReflectionHelper ? This to limiting dependency on the fork, wdyt ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good point, I will test this


/** The start offset of array data relative to the start address of the array object. */
private static final long BYTE_ARRAY_BASE_OFFSET;
public static final long BYTE_ARRAY_BASE_OFFSET;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same for this offset, it seems we are also getting this value in Federate by using reflection as it is done here

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.

2 participants