Skip to content

GH-1460: Log the allocation manager inferred from the classpath instead of hardcoding log with netty - #1461

Merged
jbonofre merged 1 commit into
apache:mainfrom
raulcd:GH-1460
Nov 13, 2026
Merged

jbonofre merged 1 commit into
apache:mainfrom
raulcd:GH-1460

Conversation

@raulcd

@raulcd raulcd commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

What's Changed

Previous log was wrong and hardcoded:

12:40:22.176 [main] INFO  o.a.a.m.DefaultAllocationManagerOption - allocation manager type not specified, using netty as the default type
12:40:22.178 [main] INFO  o.apache.arrow.memory.CheckAllocator - Using DefaultAllocationManager at memory-unsafe/20.0.0-SNAPSHOT/arrow-memory-unsafe-20.0.0-SNAPSHOT.jar!/org/apache/arrow/memory/unsafe/DefaultAllocationManagerFactory.class

New log shows for memory-unsafe:

13:13:56.672 [main] INFO  o.apache.arrow.memory.CheckAllocator - Using DefaultAllocationManager at memory/memory-unsafe/target/classes/org/apache/arrow/memory/unsafe/DefaultAllocationManagerFactory.class
13:13:56.680 [main] INFO  o.a.a.m.DefaultAllocationManagerOption - allocation manager type not specified, inferred org.apache.arrow.memory.unsafe.DefaultAllocationManagerFactory from the classpath

For netty:

13:13:51.165 [main] INFO  o.apache.arrow.memory.CheckAllocator - Using DefaultAllocationManager at memory/memory-netty/target/classes/org/apache/arrow/memory/netty/DefaultAllocationManagerFactory.class
13:13:51.219 [main] INFO  o.a.a.m.DefaultAllocationManagerOption - allocation manager type not specified, inferred org.apache.arrow.memory.netty.DefaultAllocationManagerFactory from the classpath

Closes #1460.

@raulcd raulcd added the bug-fix PRs that fix a big. label Nov 12, 2026
@github-actions github-actions Bot added this to the 20.0.0 milestone Nov 12, 2026
@lidavidm

Copy link
Copy Markdown
Member

I'll let JB decide on merge since AFAIK he's still working on 20.0.0/declared a freeze

@jbonofre jbonofre 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, thanks for the fix @raulcd!

The old messages always said "netty", which was wrong whatever unsafe was picked from the classpath, so this make it much easier to see what's actually is in use.

@jbonofre
jbonofre merged commit 24f5cb1 into apache:main Nov 13, 2026
21 of 24 checks passed
jbonofre added a commit that referenced this pull request Nov 13, 2026
…lasspath (#1470)

## 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.
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.

Message for default allocator using netty contradicts real allocator used (memory-unsafe)

3 participants