This is an automated email from the ASF dual-hosted git repository.
abhishekrb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 425b9062933 Bump JNA version from 5.13.0 to 5.18.1 for Oshi monitor
(#18848)
425b9062933 is described below
commit 425b9062933ee80e5250bda6d7dd848c1c5d19c0
Author: Abhishek Radhakrishnan <[email protected]>
AuthorDate: Wed Dec 17 15:30:46 2025 -0500
Bump JNA version from 5.13.0 to 5.18.1 for Oshi monitor (#18848)
* Follow up to https://github.com/apache/druid/pull/18839
Newer versions of Oshi requires a bump in JNA dependency too. Without that,
running quickstart
with oshi sys monitor will fail processes with the following error:
Caused by: java.lang.NoClassDefFoundError:
com/sun/jna/platform/mac/CoreFoundation$CFLocale
at
oshi.software.os.mac.MacOperatingSystem.<init>(MacOperatingSystem.java:58)
at
oshi.software.os.mac.MacOperatingSystemJNA.<init>(MacOperatingSystemJNA.java:54)
at oshi.SystemInfo.createOperatingSystem(SystemInfo.java:87)
at oshi.util.Memoizer$1.get(Memoizer.java:65)
at oshi.SystemInfo.getOperatingSystem(SystemInfo.java:76)
at
org.apache.druid.java.util.metrics.OshiSysMonitor.<init>(OshiSysMonitor.java:102)
at
org.apache.druid.java.util.metrics.OshiSysMonitor.<init>(OshiSysMonitor.java:90)
Adds a unit test that fails locally with the same error without the jna
dependencies bumped up.
---
licenses.yaml | 4 ++--
pom.xml | 4 ++--
.../java/util/metrics/OshiSysMonitorTest.java | 22 +++++++++++++++++-----
3 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/licenses.yaml b/licenses.yaml
index 63b1922127e..eba44c68707 100644
--- a/licenses.yaml
+++ b/licenses.yaml
@@ -1643,7 +1643,7 @@ name: Java Native Access (JNA)
license_category: binary
module: java-core
license_name: Apache License version 2.0
-version: 5.13.0
+version: 5.18.1
libraries:
- net.java.dev.jna: jna
@@ -4796,7 +4796,7 @@ libraries:
name: net.java.dev.jna jna-platform
license_category: binary
-version: 5.13.0
+version: 5.18.1
module: druid-ranger-security
license_name: Apache License version 2.0
libraries:
diff --git a/pom.xml b/pom.xml
index 7f1328cd41b..ac87329811b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -117,8 +117,8 @@
<protobuf.version>3.25.8</protobuf.version>
<resilience4j.version>1.3.1</resilience4j.version>
<slf4j.version>2.0.16</slf4j.version>
- <jna.version>5.13.0</jna.version>
- <jna-platform.version>5.13.0</jna-platform.version>
+ <jna.version>5.18.1</jna.version>
+ <jna-platform.version>5.18.1</jna-platform.version>
<hadoop.compile.version>3.3.6</hadoop.compile.version>
<graaljs.version>22.3.5</graaljs.version>
<mockito.version>5.14.2</mockito.version>
diff --git
a/processing/src/test/java/org/apache/druid/java/util/metrics/OshiSysMonitorTest.java
b/processing/src/test/java/org/apache/druid/java/util/metrics/OshiSysMonitorTest.java
index c31ee8ea776..d6c982169fe 100644
---
a/processing/src/test/java/org/apache/druid/java/util/metrics/OshiSysMonitorTest.java
+++
b/processing/src/test/java/org/apache/druid/java/util/metrics/OshiSysMonitorTest.java
@@ -52,11 +52,6 @@ public class OshiSysMonitorTest
private HardwareAbstractionLayer hal;
private OperatingSystem os;
- private enum STATS
- {
- MEM, SWAP, FS, DISK, NET, CPU, SYS, TCP
- }
-
@Before
public void setUp()
{
@@ -137,6 +132,23 @@ public class OshiSysMonitorTest
emitter.verifyEmitted("sys/fs/max", 0);
}
+ @Test
+ public void testJnaBindingsWithRealSystemInfo()
+ {
+ // Use a real SystemInfo instance rather than a mock to ensure all
Oshi/JNA bindings are correctly wired
+ OshiSysMonitor m = createMonitor(new SystemInfo(), List.of("mem"));
+ StubServiceEmitter emitter = new StubServiceEmitter();
+
+ m.start();
+ m.doMonitor(emitter);
+ m.stop();
+
+ emitter.verifyEmitted("sys/mem/max", 1);
+ emitter.verifyEmitted("sys/mem/used", 1);
+ emitter.verifyEmitted("sys/mem/free", 1);
+ emitter.verifyEmitted("sys/fs/max", 0);
+ }
+
@Test
public void testSwapStats()
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]