Skip to content

Fix Solaris kstat2 for non-zero CPU instances, cap FileSystemTest - #3326

Merged
dbwiddis merged 2 commits into
oshi:masterfrom
dbwiddis:solaris-sparc-debug
Jun 4, 2026
Merged

dbwiddis merged 2 commits into
oshi:masterfrom
dbwiddis:solaris-sparc-debug

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Jun 4, 2026 •

Copy link
Copy Markdown
Member

Fixes discovered while debugging cfarm216 (Solaris 11.4 SPARC LDOM with CPUs starting at instance 64):

Solaris kstat2 fixes:

  • queryKstat2List: handle non-zero-based and gapped kstat instances (tolerates up to 256 consecutive misses before stopping iteration)
  • queryProcessorId2: use queryKstat2List instead of hardcoding cpu/0 path
  • HAS_KSTAT2: validate with runtime probe using universal kstat:/pages/unix/system_pages path

Test fixes:

  • FileSystemTest: cap updateAttributes() to first 10 stores (avoids 22-minute hang on systems with many NFS mounts)
  • ProcessStatTest: fix flaky testQuerySocketToPidMap in containers where no sockets may be visible

CI:

  • Re-enable full test suite on cfarm216 (kstat2 now works correctly)

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced validation logic for system component detection to improve reliability in restricted environments.
    • Optimized query iteration with proper termination conditions to prevent infinite loops.
  • Tests

    • Improved test flexibility for constrained system environments, such as containers.
    • Refined test scope to focus validation on critical system data.

dbwiddis added 2 commits June 4, 2026 00:20
- [SPARC-DEBUG] warn logging in SolarisCentralProcessor for kstat chain
- [TIMING] warn logging in SystemInfoTest for each phase
- [TIMING] warn logging in FileSystemTest for getFileStores and iteration
- Dedicated solaris-debug.yaml workflow with kstat/df diagnostics
- queryKstat2List: handle non-zero-based and gapped kstat instances
  (tolerates up to 256 consecutive misses before stopping)
- queryProcessorId2: use queryKstat2List instead of hardcoding cpu/0
- HAS_KSTAT2: validate with runtime probe using universal kstat path
- FileSystemTest: cap updateAttributes() to first 10 stores
  (avoids 22-minute hang on systems with many NFS mounts)
- ProcessStatTest: fix flaky testQuerySocketToPidMap in containers
- unix.yaml: re-enable full test suite on cfarm216
@coderabbitai

coderabbitai Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR improves Solaris kstat2 handling robustness and makes tests more resilient to constrained environments. The main functional change enhances kstat2 availability detection, bounds list iteration to prevent infinite loops, and updates processor queries to use the safer approach. Supporting changes expand CI test coverage and relax test assertions for restricted systems.

Changes

Solaris Kstat2 Availability Detection and Bounded Query Strategy

Layer / File(s) Summary
Enhanced HAS_KSTAT2 initialization with runtime validation
oshi-core/src/main/java/oshi/software/os/unix/solaris/SolarisOperatingSystem.java
HAS_KSTAT2 static initializer now performs actual kstat2 data read verification: opens a Kstat2Handle, looks up kstat:/pages/unix/system_pages, verifies the physmem field exists, and handles Kstat2StatusException and linkage failures. Added imports for Kstat2Handle, Kstat2Map, and Kstat2StatusException.
Bounded Kstat2 list iteration with termination strategy
oshi-core/src/main/java/oshi/util/platform/unix/solaris/KstatUtil.java
queryKstat2List replaced unbounded iteration with a termination condition: tracks consecutiveMisses counter and stops after 256 successive Kstat2StatusException failures. Refactored dataLookupString and dataLookupLong switch-case formatting without changing behavior.
Processor identification via bounded kstat2 list query
oshi-core/src/main/java/oshi/hardware/platform/unix/solaris/SolarisCentralProcessor.java
queryProcessorId2 switched from single Kstat2 query to queryKstat2List call, using the first result element for vendor/brand/family/model/stepping/clock fields. queryProcessorCpuLoadTicks refactored to store kc.lookupAll results in a local List before iteration.

Test and CI Environment Resilience

Layer / File(s) Summary
CI workflow scope expansion
.github/workflows/unix.yaml
Solaris SPARC test job expanded from running only oshi-common and oshi-core modules (-pl oshi-common,oshi-core) to running ./mvnw clean test on the whole project, keeping the same retry and skip-coverage flags.
Linux proc test relaxation for restricted environments
oshi-common/src/test/java/oshi/util/driver/linux/proc/ProcessStatTest.java
Added Hamcrest matcher imports (is, notNullValue); testQuerySocketToPidMap now asserts socket-to-pid map is non-null rather than non-empty to accommodate containers where /proc access restrictions may yield empty results.
Filesystem test assertion limiting for constrained environments
oshi-core/src/test/java/oshi/software/os/shared/FileSystemTest.java
FileSystemTest collects OSFileStore instances into a List before iteration and limits updateAttributes() assertions to the first 10 stores using an updateCount counter, checking totalSpace non-change and usableSpace validity only within that bounded set.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • oshi/oshi#3323: Modifies the same Solaris SPARC CI SSH job retry loop, adjusting test module scope in the workflow.

Poem

🐰 Kstat2 bounds now stand firm and true,
No infinite loops shall break through.
Tests relax their grip where access is tight—
A more resilient suite, tried and right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main changes: fixing Solaris kstat2 for non-zero CPU instances and capping FileSystemTest, which are the primary objectives of this PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.89%. Comparing base (5daa9b4) to head (2452590).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3326      +/-   ##
============================================
- Coverage     75.01%   74.89%   -0.12%     
  Complexity       76       76              
============================================
  Files           455      455              
  Lines         17492    17492              
  Branches       2872     2872              
============================================
- Hits          13121    13101      -20     
- Misses         2780     2791      +11     
- Partials       1591     1600       +9     
Flag Coverage Δ
freebsd 30.73% <ø> (+<0.01%) ⬆️
linux 37.71% <ø> (+0.01%) ⬆️
macos 38.00% <ø> (-0.01%) ⬇️
windows 45.20% <ø> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
oshi-core/src/main/java/oshi/util/platform/unix/solaris/KstatUtil.java (1)

294-330: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Preserve the matched kstat instance instead of only the values.

This scan can now find sparse/non-zero CPU maps, but queryKstat2List() still drops the instance number and forces callers to treat list position as CPU id. That breaks the cross-file contract in SolarisCentralProcessor: initProcessorCounts2() assigns procId = logProcs.size() while mapNumaNodes() is keyed by real CPU ids from lgrpinfo (Lines 145-157 and 160-180), and the frequency/tick paths also fill arrays by ordinal (Lines 217-229 and 311-324). On the exact systems this PR targets, you'll still misattribute per-CPU metadata even when lookup succeeds. Return (instance, values) or a map keyed by instance, and let callers build/logically order processors from the real ids rather than row order.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@oshi-core/src/main/java/oshi/util/platform/unix/solaris/KstatUtil.java`
around lines 294 - 330, queryKstat2List currently discards the kstat instance
number and returns only values (List<Object[]>), causing callers like
SolarisCentralProcessor to misattribute per-CPU metadata; change queryKstat2List
to preserve the numeric instance from the lookup key and return either a
Map<Integer,Object[]> keyed by instance or a List of (instance, values) tuples
so callers can order by real CPU id, i.e., when you call
handle.lookupMap(beforeStr + s + afterStr) capture s (the instance) and store it
with the result instead of only adding result to results; update callers (e.g.,
initProcessorCounts2, mapNumaNodes and frequency/tick paths) to consume the
instance-keyed results and build processor arrays in real-id order.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@oshi-core/src/main/java/oshi/util/platform/unix/solaris/KstatUtil.java`:
- Around line 294-330: queryKstat2List currently discards the kstat instance
number and returns only values (List<Object[]>), causing callers like
SolarisCentralProcessor to misattribute per-CPU metadata; change queryKstat2List
to preserve the numeric instance from the lookup key and return either a
Map<Integer,Object[]> keyed by instance or a List of (instance, values) tuples
so callers can order by real CPU id, i.e., when you call
handle.lookupMap(beforeStr + s + afterStr) capture s (the instance) and store it
with the result instead of only adding result to results; update callers (e.g.,
initProcessorCounts2, mapNumaNodes and frequency/tick paths) to consume the
instance-keyed results and build processor arrays in real-id order.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 99ce5459-f5fc-470a-888d-c1402d597142

📥 Commits

Reviewing files that changed from the base of the PR and between 6cab958 and 2452590.

📒 Files selected for processing (6)
  • .github/workflows/unix.yaml
  • oshi-common/src/test/java/oshi/util/driver/linux/proc/ProcessStatTest.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/solaris/SolarisCentralProcessor.java
  • oshi-core/src/main/java/oshi/software/os/unix/solaris/SolarisOperatingSystem.java
  • oshi-core/src/main/java/oshi/util/platform/unix/solaris/KstatUtil.java
  • oshi-core/src/test/java/oshi/software/os/shared/FileSystemTest.java
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test JDK 21, windows-latest
  • GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 21, macos-latest
  • GitHub Check: Test JDK 26, macos-latest
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 26, windows-latest
  • GitHub Check: JMH Benchmarks, windows-latest
  • GitHub Check: JMH Benchmarks, macos-latest
  • GitHub Check: JMH Benchmarks, ubuntu-latest
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
  • GitHub Check: Test JDK 25, FreeBSD (+ JNA==FFM)
  • GitHub Check: Analyze (java)
🧰 Additional context used
🧠 Learnings (15)
📓 Common learnings
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3307
File: .github/workflows/netbsd.yaml:4-8
Timestamp: 2026-05-30T02:27:59.447Z
Learning: In the oshi/oshi repository, the `.github/workflows/netbsd.yaml` CI workflow intentionally triggers only on `push` to the `netbsd-port` branch during development. Before the final merge to master, NetBSD CI will be integrated into the main Unix CI workflow (e.g., `.github/workflows/pr.yaml` or equivalent). Do not flag the limited trigger scope as an issue on this PR.
📚 Learning: 2026-04-10T22:44:36.786Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3136
File: oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxOperatingSystemFFM.java:46-53
Timestamp: 2026-04-10T22:44:36.786Z
Learning: In OSHI's `AuxvFFM.queryAuxv()` (oshi-core-java25/src/main/java/oshi/driver/linux/proc/AuxvFFM.java), the do-while loop is safe even when `/proc/self/auxv` cannot be read: `FileUtil.readAllBytesAsBuffer` returns an empty ByteBuffer on failure, and `FileUtil.readLongFromBuffer`/`readIntFromBuffer` return 0L when reading past the buffer limit. This 0L equals AT_NULL, causing the loop to exit immediately with an empty map, which triggers the `getconf`/hardcoded-default fallback in callers like `LinuxOperatingSystemFFM`. Do not flag this do-while loop or the static initializer that calls `AuxvFFM.queryAuxv()` as unsafe.

Applied to files:

  • oshi-common/src/test/java/oshi/util/driver/linux/proc/ProcessStatTest.java
  • oshi-core/src/main/java/oshi/software/os/unix/solaris/SolarisOperatingSystem.java
📚 Learning: 2026-05-18T23:38:59.650Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3267
File: oshi-common/src/main/java/oshi/driver/common/windows/wmi/Win32Process.java:89-100
Timestamp: 2026-05-18T23:38:59.650Z
Learning: In `oshi-common/src/main/java/oshi/driver/common/windows/wmi/Win32Process.java`, the `queryProcesses(WmiQueryExecutor h, Collection<Integer> pids)` method intentionally uses `Collection<Integer>` (not `Set<Integer>`) to match the JNA original and to remain flexible for callers passing `List` or other collection types. The `queryCommandLines` method uses `Set<Integer>` only because its callers happen to pass sets. Do not suggest narrowing `queryProcesses` to `Set<Integer>`.

Applied to files:

  • oshi-common/src/test/java/oshi/util/driver/linux/proc/ProcessStatTest.java
📚 Learning: 2026-04-18T03:18:06.205Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3170
File: oshi-benchmark/src/test/java/oshi/comparison/PerfmonComparisonTest.java:177-183
Timestamp: 2026-04-18T03:18:06.205Z
Learning: In `oshi-benchmark/src/test/java/oshi/comparison/PerfmonComparisonTest.java`, GPU engine PDH instance counts (from `GpuInformationJNA.queryGpuEngineCounters()` / `GpuInformationFFM.queryGpuEngineCounters()`) are highly volatile — counts can differ dramatically (e.g., 53 vs 40) even between queries taken milliseconds apart. Do not assert instance count equality or exact instance list matching between JNA and FFM results. The only reliable assertion is that both are empty or both are non-empty (`assertThat(ffm.getA().isEmpty()).isEqualTo(jna.getA().isEmpty())`).

Applied to files:

  • oshi-common/src/test/java/oshi/util/driver/linux/proc/ProcessStatTest.java
  • oshi-core/src/test/java/oshi/software/os/shared/FileSystemTest.java
📚 Learning: 2026-04-03T02:07:49.467Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3110
File: oshi-core-java25/src/main/java/oshi/hardware/platform/mac/MacHWDiskStoreFFM.java:119-121
Timestamp: 2026-04-03T02:07:49.467Z
Learning: In `oshi-core-java25/src/main/java/oshi/hardware/platform/mac/MacHWDiskStoreFFM.java` (and similar FFM/API implementations in OSHI), the `updateAttributes()` method intentionally uses `catch (Throwable e) { return false; }` without logging. This is by design: `updateAttributes()` is a public API method whose contract is to return `false` on failure; callers consume the boolean and would never see log output, so adding a log statement is not desired.

Applied to files:

  • oshi-core/src/test/java/oshi/software/os/shared/FileSystemTest.java
📚 Learning: 2026-05-30T02:27:59.447Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3307
File: .github/workflows/netbsd.yaml:4-8
Timestamp: 2026-05-30T02:27:59.447Z
Learning: In the oshi/oshi repository, the `.github/workflows/netbsd.yaml` CI workflow intentionally triggers only on `push` to the `netbsd-port` branch during development. Before the final merge to master, NetBSD CI will be integrated into the main Unix CI workflow (e.g., `.github/workflows/pr.yaml` or equivalent). Do not flag the limited trigger scope as an issue on this PR.

Applied to files:

  • .github/workflows/unix.yaml
📚 Learning: 2026-05-31T05:53:04.246Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3311
File: .github/workflows/site.yaml:21-21
Timestamp: 2026-05-31T05:53:04.246Z
Learning: When a GitHub Actions workflow verifies that a pinned commit SHA matches a version tag, dereference annotated tags before comparing to a commit SHA. The API `GET /repos/{owner}/{repo}/git/refs/tags/{tag}` returns the tag *object* SHA for annotated tags (not the underlying commit SHA), so comparing it directly to a commit SHA will cause false mismatches. Instead: (1) fetch the tag object SHA via `GET /repos/{owner}/{repo}/git/refs/tags/{tag}`; (2) resolve that tag object to the underlying commit by calling `GET /repos/{owner}/{repo}/git/tags/{tag_object_sha}`; (3) compare the pinned commit SHA to the resolved commit at `.object.sha`.

Applied to files:

  • .github/workflows/unix.yaml
📚 Learning: 2026-03-29T20:01:06.452Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3014
File: oshi-core-java11/src/main/java/module-info.java:10-17
Timestamp: 2026-03-29T20:01:06.452Z
Learning: In the oshi project, `oshi-core-java25/src/main/java/module-info.java` intentionally does NOT export `oshi.util.platform.unix.freebsd`, `oshi.util.platform.unix.openbsd`, or `oshi.util.platform.unix.solaris`, because the FFM (Foreign Function & Memory) implementation only supports Windows, macOS, and Linux. This differs from `oshi-core-java11/src/main/java/module-info.java` which exports all Unix platform packages. The asymmetry is by design.

Applied to files:

  • oshi-core/src/main/java/oshi/software/os/unix/solaris/SolarisOperatingSystem.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/solaris/SolarisCentralProcessor.java
  • oshi-core/src/main/java/oshi/util/platform/unix/solaris/KstatUtil.java
📚 Learning: 2026-05-04T04:58:36.843Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3227
File: oshi-metrics/src/main/java/oshi/metrics/OshiMetrics.java:35-48
Timestamp: 2026-05-04T04:58:36.843Z
Learning: In `oshi-metrics/src/main/java/oshi/metrics/OshiMetrics.java`, the `private final OperatingSystem os` field is intentionally stored in the constructor even though it is not yet used. It is a placeholder for future OS-level metrics (e.g., process metrics) that will be added incrementally. Do not flag it as dead code.

Applied to files:

  • oshi-core/src/main/java/oshi/software/os/unix/solaris/SolarisOperatingSystem.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/solaris/SolarisCentralProcessor.java
📚 Learning: 2026-04-06T04:45:47.644Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3121
File: oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystem.java:53-53
Timestamp: 2026-04-06T04:45:47.644Z
Learning: In the oshi/oshi project, only interfaces and classes in the root packages `oshi`, `oshi.hardware`, and `oshi.software.os` are considered the public API. Code in subpackages that represent specific implementations/platforms (e.g., `oshi.software.os.linux`, `oshi.hardware.platform.linux`, and similar subpackages) is implementation detail. When reviewing, do not treat changes to classes in these platform-specific subpackages as public API breaks (for example: making `LinuxOperatingSystem` abstract, narrowing constructor visibility, or adding/removing abstract methods should not be flagged as breaking public API).

Applied to files:

  • oshi-core/src/main/java/oshi/software/os/unix/solaris/SolarisOperatingSystem.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/solaris/SolarisCentralProcessor.java
📚 Learning: 2026-05-31T04:49:16.646Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3310
File: oshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOperatingSystem.java:164-166
Timestamp: 2026-05-31T04:49:16.646Z
Learning: In the oshi/oshi project, the NetBSD platform intentionally removes all JNA/native library dependencies (PR `#3310`). `NetBsdOperatingSystem.getThreadId()` uses `(int) Thread.currentThread().getId()` rather than `NetBsdLibc._lwp_self()` because the JNA native library is not bundled with the Maven dependency for the NetBSD platform. The mismatch between Java thread ids and kernel LWP ids is an accepted trade-off. Do not suggest reintroducing JNA-based calls (such as `NetBsdLibc._lwp_self()`) in NetBSD platform code.

Applied to files:

  • oshi-core/src/main/java/oshi/hardware/platform/unix/solaris/SolarisCentralProcessor.java
  • oshi-core/src/main/java/oshi/util/platform/unix/solaris/KstatUtil.java
📚 Learning: 2026-04-03T18:44:48.200Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3112
File: oshi-core/src/main/java/oshi/PlatformEnum.java:63-66
Timestamp: 2026-04-03T18:44:48.200Z
Learning: In oshi/oshi PlatformEnum.java, the DRAGONFLYBSD enum constant is intentionally added for platform detection only (no implementation classes exist yet). It allows UnsupportedOperationException messages to say "DragonFly BSD" rather than "Unknown". Full DragonFly BSD support is tracked in issue `#2583`. Do not flag the missing switch-case implementations as a bug.

Applied to files:

  • oshi-core/src/main/java/oshi/hardware/platform/unix/solaris/SolarisCentralProcessor.java
  • oshi-core/src/main/java/oshi/util/platform/unix/solaris/KstatUtil.java
📚 Learning: 2026-04-06T04:45:51.516Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3121
File: oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystem.java:53-53
Timestamp: 2026-04-06T04:45:51.516Z
Learning: In the oshi/oshi project, the public API is strictly limited to interfaces and classes in the `oshi`, `oshi.hardware`, and `oshi.software.os` packages. All platform-specific code under subpackages like `oshi.software.os.linux`, `oshi.hardware.platform.linux`, etc., is considered implementation detail — not public API. Do not flag changes to platform-specific classes (e.g., making `LinuxOperatingSystem` abstract, narrowing constructor visibility, adding abstract methods) as public API breaks.

Applied to files:

  • oshi-core/src/main/java/oshi/util/platform/unix/solaris/KstatUtil.java
📚 Learning: 2026-04-03T18:43:51.290Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3112
File: oshi-core/src/main/java/oshi/PlatformEnum.java:99-100
Timestamp: 2026-04-03T18:43:51.290Z
Learning: In oshi/oshi PlatformEnum.java, the DragonFly BSD detection uses `osName.equalsIgnoreCase("dragonflybsd")` intentionally, mirroring the exact same check in JNA's `Platform.java` source. Java's `os.name` property on DragonFly BSD is "dragonflybsd" (no space), so `startsWith("DragonFly")` is NOT the correct pattern here. Do not suggest changing it to `startsWith`.

Applied to files:

  • oshi-core/src/main/java/oshi/util/platform/unix/solaris/KstatUtil.java
📚 Learning: 2026-04-17T23:56:46.416Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3168
File: oshi-core-java25/src/main/java/oshi/util/platform/windows/PerfDataUtilFFM.java:287-298
Timestamp: 2026-04-17T23:56:46.416Z
Learning: In `oshi-core-java25/src/main/java/oshi/util/platform/windows/PerfDataUtilFFM.java`, the `queryWildcardCounters` method intentionally aborts and returns an empty Pair when any `addEnglishCounter` call fails. This is by design: the returned `Pair<List<String>, Map<T, List<Long>>>` requires strict parallel alignment between the instance list and each per-property value list. Aborting on failure preserves this alignment contract. This is different from `queryCounters` (non-wildcard), which gracefully skips individual failed counters since it returns a flat `Map<T, Long>` with no alignment constraint.

Applied to files:

  • oshi-core/src/main/java/oshi/util/platform/unix/solaris/KstatUtil.java
🔇 Additional comments (6)
.github/workflows/unix.yaml (1)

105-105: LGTM!

oshi-common/src/test/java/oshi/util/driver/linux/proc/ProcessStatTest.java (2)

10-11: LGTM!


97-98: LGTM!

oshi-core/src/test/java/oshi/software/os/shared/FileSystemTest.java (3)

12-12: LGTM!


41-43: LGTM!


71-81: LGTM!

@dbwiddis
dbwiddis merged commit cde1e07 into oshi:master Jun 4, 2026
20 checks passed
@dbwiddis
dbwiddis deleted the solaris-sparc-debug branch June 4, 2026 02:51
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.

1 participant