Skip to content

GH-1469: Infer the allocation manager from the factory found on the classpath - #1470

Merged
jbonofre merged 2 commits into
apache:mainfrom
jbonofre:allocator-inference
Nov 13, 2026
Merged

jbonofre merged 2 commits into
apache:mainfrom
jbonofre:allocator-inference

Conversation

@jbonofre

Copy link
Copy Markdown
Member

What's Changed

Follow-up to #1461. When no allocation manager type is set, CheckAllocator.check() used to pick the factory class by searching the resource location for memory-core, memory-unsafe or memory-netty. It now looks up each known DefaultAllocationManagerFactory resource and returns the factory it actually found:

  • A Netty or Unsafe factory loaded from a location containing memory-core is no longer inferred as the memory-core test factory.
  • The precedence is unchanged (Unsafe before Netty), but a warning is now logged when several allocation manager types are on the classpath, with the property / environment variable to choose one.
  • The inference is logged once, with the Netty / Unsafe name accepted by arrow.allocation.manager.type and the full location:
INFO  o.apache.arrow.memory.CheckAllocator - Allocation manager type not specified, inferred Unsafe from the classpath at file:/.../memory/memory-unsafe/target/classes/org/apache/arrow/memory/unsafe/DefaultAllocationManagerFactory.class

With both Unsafe and Netty on the classpath:

WARN  o.apache.arrow.memory.CheckAllocator - Found allocation manager types [Unsafe, Netty] on the classpath, using Unsafe. Set the arrow.allocation.manager.type system property or the ARROW_ALLOCATION_MANAGER_TYPE environment variable to choose one explicitly

TestCheckAllocator covers the inference with a class loader serving resources from chosen locations.

Closes #1469.

… the classpath

CheckAllocator now looks up each known DefaultAllocationManagerFactory
and returns the one it found, instead of guessing from the location name.
It warns when several allocation manager types are on the classpath, and
logs the inferred type (Netty/Unsafe) with its location on a single line.

Closes apache#1469.
@jbonofre jbonofre added the bug-fix PRs that fix a big. label Nov 13, 2026
@github-actions github-actions Bot added this to the 20.0.0 milestone Nov 13, 2026

@lidavidm lidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just needs to be formatted

@jbonofre
jbonofre merged commit e77811e into apache:main Nov 13, 2026
21 checks passed
@jbonofre
jbonofre deleted the allocator-inference branch November 13, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PRs that fix a big.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allocation manager inference depends on the classpath location name

3 participants