Java 21 breaks access to netty-buffer class
- 主要言語
- Java
- スター
- 94
- フォーク
- 152
- 平均マージ
- 3日 16時間
- マージ済み PR(30日)
- 11
説明
### Describe the bug, including details regarding any error messages, version, and platform.
When trying to start an Arrow Flight server use is made of class `io.netty.buffer.PoolArena` in netty-buffer that is no longer accessible in java 21 from class `io.netty.buffer.PooledByteBufAllocatorL` in `arrow-memory-netty-buffer-patch-19.0.0.jar`.
I think this might be caused by Java 21 being more restrictive than 17.
Stack trace
```java
Exception in thread "main" java.lang.IllegalAccessError: failed to access class io.netty.buffer.PoolArena from class io.netty.buffer.PooledByteBufAllocatorL$InnerAllocator (io.netty.buffer.PoolArena is in unnamed module of loader 'app'; io.netty.buffer.PooledByteBufAllocatorL$InnerAllocator is in unnamed module of loader org.apache.hop.core.plugins.HopURLClassLoader @26612078)
at io.netty.buffer.PooledByteBufAllocatorL$InnerAllocator.(PooledByteBufAllocatorL.java:141)
at io.netty.buffer.PooledByteBufAllocatorL.(PooledByteBufAllocatorL.java:46)
at org.apache.arrow.memory.netty.NettyAllocationManager.(NettyAllocationManager.java:54)
at org.apache.arrow.memory.netty.DefaultAllocationManagerFactory.(DefaultAllocationManagerFactory.java:26)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:423)
at java.base/java.lang.Class.forName(Class.java:414)
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)
at org.apache.arrow.memory.ImmutableConfig.access$001(ImmutableConfig.java:20)
at org.apache.arrow.memory.ImmutableConfig$InitShim.getAllocationManagerFactory(ImmutableConfig.java:80)
at org.apache.arrow.memory.ImmutableConfig.(ImmutableConfig.java:43)
at org.apache.arrow.memory.ImmutableConfig$Builder.build(ImmutableConfig.java:492)
at org.apache.arrow.memory.BaseAllocator.(BaseAllocator.java:72)
at org.apache.hop.arrow.flight.ArrowFlightServer.(ArrowFlightServer.java:59)
at org.apache.hop.arrow.command.ArrowCommand.run(ArrowCommand.java:108)
at picocli.CommandLine.executeUserObject(CommandLine.java:2045)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2469)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2423)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2425)
at picocli.CommandLine.execute(CommandLine.java:2174)
at org.apache.hop.hop.Hop.main(Hop.java:131)
```
コントリビューションガイド
調査の方向性
まず、Java 21 で Arrow Flight サーバーを起動する際の失敗を再現し、次にスタックトレースで特定されている PooledByteBufAllocatorL と NettyAllocationManager を調査します。関連するアクセス動作を Java 17 と比較します。IllegalAccessError が発生しなくなり、サーバーが正常に起動すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- backend, data-engineering
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100