Skip to content

Support parameterized log messages in ExceptionUtil and callInArena helpers - #3530

Merged
dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:exceptionutil-varargs-catch-sweep
Jul 26, 2026
Merged

dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:exceptionutil-varargs-catch-sweep

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Jul 26, 2026 •

Copy link
Copy Markdown
Member

Completes the sweep started in #3528. That PR converted the catch blocks whose message needed no argument but the exception; the 29 that remained all log extra context — a path, a pid, a registry key — which the helpers had no way to express. This adds that support and converts 27 of them.

No user-facing change, so no CHANGELOG entry.

ExceptionUtil — modified in place, no new methods

msg was already the last parameter, so appending Object... args to the 18 logging overloads leaves every existing call site compiling unchanged. Caller arguments fill the leading placeholders in order, then the exception message fills a final one:

getOrDefault(() -> ..., "", LOG, "Failed to read {} of {}: {}", path, valueName);
//                                              ^^    ^^   ^^ exception message

Safe to change in place because ExceptionUtil is not @oshi.annotation.PublicApi, and japicmp is configured to gate only @PublicApi types.

ForeignFunctions — five new overloads, default value second

callInArena* takes the default value last, leaving no room for a trailing varargs, so it needs new overloads rather than an in-place change. They take the default second, matching ExceptionUtil's existing (operation, defaultValue, log, level, msg, args...) order so both utilities read the same way.

Second rather than merely swapped with the message on purpose. With the default fourth, this call — whose T is String, so message and default have the same type — matches both overloads:

callInArenaOrDefault(c, LOG, DEBUG, "the message", "the default")

Java resolves fixed-arity before varargs, so it would silently bind to the older overload with the two transposed. That is reachable in practice (KstatUtilFFM.dataLookupString returns String). Putting the default second makes argument three a Logger in one form and a LogLevel in the other, so the two cannot collide at any arity. ForeignFunctionsTest pins this down.

The two that stayed

  • WindowsGraphicsCardFFM.getGraphicsCards — the body both continues the enclosing loop and increments an enclosing local. A lambda can do neither.
  • PerfDataUtilFFM.queryWildcardCounters — the nested add-counter catch aborts the whole method; a helper cannot express "abort the enclosing lambda" from inside it. The outer catch in the same method was converted, so this one now sits inside that lambda, where its return still exits the method as before.

Notable conversions

  • WindowsOSProcessFFM.queryUserInfo / queryGroupInfo assigned an enclosing local read after the try. They were near-identical twins differing only in the token class and one noun, so both now delegate to a single queryTokenAccountInfo whose lambda returns the pair directly.
  • InstalledAppsDataFFM had a continue skipping the current registry key. Inside a runOrLog lambda the equivalent is return — the enclosing loop still advances.
  • PerfDataUtilFFM.queryCounters needed its query handle read into an effectively-final local so the per-counter lambdas could capture it. Previously it was assigned inside the try with a null guard in finally; the handle is read immediately after a checked PdhOpenQuery, so hoisting it changes nothing (in both forms a throw before the assignment leaves the handle unclosed).

Verification

Clean full-reactor install: 1127 + 84 + 71 + 30 tests, 0 failures. Spotless, checkstyle, forbidden-apis and javadoc all clean. New tests cover argument ordering, the zero-argument path being unchanged, the success path logging nothing, and the overload-resolution hazard above.

Also ran the FFM provider live on macOS (M2 Max) over the affected paths. Specifically checked that en0 still resolves to Wi-Fi through SCNetworkInterface rather than falling back to the raw interface name — a broken conversion of MacNetworkIfFFM.queryIfDisplayName, the site that prompted this whole sweep, would otherwise have looked healthy.

Summary by CodeRabbit

  • New Features

    • Logging helpers now support formatted messages with {} placeholders and additional arguments.
    • Native system-call utilities support formatted failure messages while returning configured fallback values.
  • Bug Fixes

    • Improved diagnostic context for failures across hardware, operating-system, registry, and performance-data queries.
    • Standardized failure handling preserves application stability by returning safe defaults instead of propagating unexpected errors.
  • Tests

    • Added coverage for formatted logging arguments, exception details, fallback behavior, and successful native-call results.

…elpers

#3528 converted the catch blocks whose log message needed no argument but the
exception. The 29 that remained all log extra context - a path, a pid, a
registry key - which the helpers could not express. This adds that support and
converts 27 of them.

ExceptionUtil gains `Object... args` on its 18 logging overloads in place,
adding no new methods: `msg` was already the last parameter, so every existing
call site still compiles. Caller arguments fill the leading placeholders in
order and the exception message fills a final one, so a message carries one {}
per argument plus a trailing one.

ForeignFunctions cannot do the same, because callInArena* takes the default
value last and leaves no room for a trailing varargs. It gains five overloads
that take the default value *second*, matching ExceptionUtil's
(operation, defaultValue, log, level, msg, args...) order.

Second rather than merely swapped with the message on purpose. With the default
fourth, a no-argument call whose T is String - reachable, e.g.
KstatUtilFFM.dataLookupString - would match both overloads, and Java resolves
fixed-arity before varargs, so it would silently bind to the older one with
message and default transposed. Putting the default second makes argument three
a Logger in one form and a LogLevel in the other, so they cannot collide at any
arity. ForeignFunctionsTest covers this.

Two sites could not be converted:

- WindowsGraphicsCardFFM.getGraphicsCards: the body both `continue`s the
  enclosing loop and increments an enclosing local.
- PerfDataUtilFFM.queryWildcardCounters: the nested add-counter catch aborts the
  whole method, which a helper cannot express from inside the enclosing lambda.

WindowsOSProcessFFM.queryUserInfo and queryGroupInfo assigned an enclosing local
read after the try. They were near-identical twins, so both now delegate to one
queryTokenAccountInfo method whose lambda returns the pair directly.

Verified with a clean full-reactor build and a live run of the FFM provider on
macOS. Checked en0 still resolves to "Wi-Fi" via SCNetworkInterface rather than
falling back to the raw interface name, which is what a broken conversion of
MacNetworkIfFFM.queryIfDisplayName would have looked like.
@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Exception logging and FFM fallback consolidation

Layer / File(s) Summary
Formatted exception logging API
oshi-common/src/main/java/oshi/util/ExceptionUtil.java, oshi-common/src/test/java/oshi/util/*Test.java
Logging helpers now accept {} arguments, append exception details, and retain default/optional/runnable behavior with expanded coverage.
Parameterized arena helpers
oshi-core-ffm/src/main/java/oshi/ffm/ForeignFunctions.java, oshi-core-ffm/src/test/java/oshi/ffm/ForeignFunctionsTest.java
Generic and primitive arena wrappers support formatted logging arguments and default returns, with success, failure, and overload-resolution tests.
FFM failure-handling migration
oshi-core-ffm/src/main/java/oshi/{driver,ffm,hardware,software}/..., oshi-core/src/main/java/oshi/software/os/mac/MacOSFileStoreJNA.java
FFM and macOS code replaces local exception handling with shared arena, default, and runOrLog helpers while preserving fallback values.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • oshi/oshi#3272: Introduces the ExceptionUtil logging helpers extended here.
  • oshi/oshi#3273: Refactors FFM implementations to use the shared ExceptionUtil helpers.
  • oshi/oshi#3284: Extends the ForeignFunctions throwable-logging path used here.

Suggested reviewers: wolfs

Poem

I’m a rabbit with logs in my den,
Formatting each error again.
Arenas now close,
Defaults gently repose,
And wrapped calls hop safely to ten!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: parameterized log-message support in ExceptionUtil and callInArena helpers.
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.
✨ 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.

@codecov

codecov Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.74684% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.80%. Comparing base (2a2b53a) to head (c75c1cd).

Files with missing lines Patch % Lines
.../oshi/software/os/windows/WindowsOSProcessFFM.java 45.45% 5 Missing and 1 partial ⚠️
.../src/main/java/oshi/driver/unix/aix/PsInfoFFM.java 0.00% 3 Missing ⚠️
...e/platform/windows/WindowsCentralProcessorFFM.java 50.00% 2 Missing ⚠️
.../software/os/unix/openbsd/OpenBsdOSProcessFFM.java 66.66% 2 Missing ⚠️
...n/java/oshi/software/os/mac/MacOSFileStoreJNA.java 50.00% 1 Missing and 1 partial ⚠️
...va/oshi/hardware/platform/mac/MacNetworkIfFFM.java 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3530      +/-   ##
============================================
+ Coverage     78.69%   78.80%   +0.10%     
- Complexity     3838     3947     +109     
============================================
  Files           698      698              
  Lines         24060    24009      -51     
  Branches       3977     3963      -14     
============================================
- Hits          18935    18920      -15     
+ Misses         2932     2898      -34     
+ Partials       2193     2191       -2     
Flag Coverage Δ
freebsd 31.30% <27.84%> (+0.08%) ⬆️
linux 35.26% <27.84%> (+0.08%) ⬆️
macos 36.20% <34.17%> (+0.05%) ⬆️
openbsd 30.50% <32.91%> (+0.08%) ⬆️
solaris 31.77% <32.91%> (+0.09%) ⬆️
windows 43.49% <63.29%> (+0.06%) ⬆️

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.

Actionable comments posted: 2

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

Inline comments:
In `@oshi-common/src/main/java/oshi/util/ExceptionUtil.java`:
- Around line 43-48: Preserve the existing fixed-arity public overloads for
ExceptionUtil.logAtLevel(..., Throwable), the get*OrDefault and getOptional(...)
log/message methods, and runOrLog(..., String) by restoring each original
signature as a forwarding overload. Keep the new varargs variants alongside
them, delegating from fixed-arity methods without changing existing behavior or
JVM method descriptors.

In `@oshi-core-ffm/src/main/java/oshi/ffm/util/platform/mac/SmcUtilFFM.java`:
- Line 31: Restore the static ERROR import in SmcUtilFFM while retaining the
existing WARN import, so the smcOpen call at line 123 continues to compile with
its current logging level.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9a7b92c6-0d6f-4cf8-a8c4-72437adb4744

📥 Commits

Reviewing files that changed from the base of the PR and between 2a2b53a and c75c1cd.

📒 Files selected for processing (20)
  • oshi-common/src/main/java/oshi/util/ExceptionUtil.java
  • oshi-common/src/test/java/oshi/util/ExceptionUtilTest.java
  • oshi-common/src/test/java/oshi/util/LogUtilTest.java
  • oshi-core-ffm/src/main/java/oshi/driver/unix/aix/PsInfoFFM.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/DeviceTreeFFM.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/registry/HkeyUserDataFFM.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/registry/InstalledAppsDataFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/ForeignFunctions.java
  • oshi-core-ffm/src/main/java/oshi/ffm/platform/windows/Cfgmgr32FFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/mac/SmcUtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/unix/solaris/KstatUtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/PerfDataUtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/hardware/platform/mac/MacHWDiskStoreFFM.java
  • oshi-core-ffm/src/main/java/oshi/hardware/platform/mac/MacNetworkIfFFM.java
  • oshi-core-ffm/src/main/java/oshi/hardware/platform/windows/WindowsCentralProcessorFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/unix/openbsd/OpenBsdOSProcessFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsOSProcessFFM.java
  • oshi-core-ffm/src/test/java/oshi/ffm/ForeignFunctionsTest.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOSFileStoreJNA.java
📜 Review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: Test JDK 25, OpenIndiana (+ JNA==FFM)
  • GitHub Check: Test JDK 25, FreeBSD (+ JNA==FFM)
  • GitHub Check: Test JDK 25, OpenBSD (+ JNA==FFM)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Analyze (java)
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2026-07-06T19:25:59.225Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3432
File: oshi-common/src/main/java/oshi/util/ExceptionUtil.java:26-56
Timestamp: 2026-07-06T19:25:59.225Z
Learning: In this repo’s SLF4J 1.x-compatible logging code, do not flag cases where a logger call uses SLF4J 1.6+ implicit-cause handling—e.g., `log.error("...{}", value, t)` (or similar with a single `{}` placeholder) where `t` is passed as the final/trailing argument. SLF4J will attach `t` as the log event’s cause with the full stack trace; this is equivalent to SLF4J 2.x’s fluent `atLevel(...).setCause(t).log(...)` and is intentionally used to preserve SLF4J 1.x runtime compatibility.

Applied to files:

  • oshi-core-ffm/src/main/java/oshi/hardware/platform/mac/MacHWDiskStoreFFM.java
  • oshi-core-ffm/src/main/java/oshi/hardware/platform/windows/WindowsCentralProcessorFFM.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/registry/InstalledAppsDataFFM.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/DeviceTreeFFM.java
  • oshi-core-ffm/src/main/java/oshi/hardware/platform/mac/MacNetworkIfFFM.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOSFileStoreJNA.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/platform/windows/Cfgmgr32FFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/unix/openbsd/OpenBsdOSProcessFFM.java
  • oshi-core-ffm/src/main/java/oshi/driver/unix/aix/PsInfoFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/mac/SmcUtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsOSProcessFFM.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/registry/HkeyUserDataFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/PerfDataUtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/ForeignFunctions.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/unix/solaris/KstatUtilFFM.java
  • oshi-common/src/main/java/oshi/util/ExceptionUtil.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/mac/MacOSFileStoreJNA.java
📚 Learning: 2026-04-12T19:22:09.716Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3149
File: oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacCentralProcessor.java:159-163
Timestamp: 2026-04-12T19:22:09.716Z
Learning: When reviewing OSHI hardware platform code that uses or implements `CentralProcessor`/`PhysicalProcessor.getEfficiency()`, remember the API’s counterintuitive semantics: a *higher* efficiency-class value indicates *greater performance* (lower efficiency). P-cores/“performance cores” should therefore have higher values (e.g., 1) than E-cores/“efficiency cores” (e.g., 0), as documented in the `CentralProcessor` Javadoc. Do not flag code as incorrect solely because ARM_P_CORES or Intel P-cores are assigned higher efficiency values.

Applied to files:

  • oshi-common/src/main/java/oshi/util/ExceptionUtil.java
🔇 Additional comments (10)
oshi-core-ffm/src/main/java/oshi/ffm/ForeignFunctions.java (1)

162-191: LGTM!

Also applies to: 218-239, 266-287, 314-335, 362-383, 595-599

oshi-core-ffm/src/test/java/oshi/ffm/ForeignFunctionsTest.java (1)

120-171: LGTM!

oshi-core-ffm/src/main/java/oshi/driver/unix/aix/PsInfoFFM.java (1)

10-11: LGTM!

Also applies to: 63-142

oshi-core-ffm/src/main/java/oshi/driver/windows/registry/HkeyUserDataFFM.java (1)

11-12: LGTM!

Also applies to: 25-25, 142-172

oshi-core-ffm/src/main/java/oshi/driver/windows/registry/InstalledAppsDataFFM.java (1)

18-19: LGTM!

Also applies to: 66-98

oshi-core-ffm/src/main/java/oshi/ffm/util/platform/mac/SmcUtilFFM.java (1)

10-12: LGTM!

Also applies to: 147-165, 193-202

oshi-core-ffm/src/main/java/oshi/ffm/util/platform/unix/solaris/KstatUtilFFM.java (1)

7-8: LGTM!

Also applies to: 120-128, 210-236, 251-274

oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java (1)

38-38: LGTM!

Also applies to: 371-430

oshi-core-ffm/src/main/java/oshi/software/os/unix/openbsd/OpenBsdOSProcessFFM.java (1)

11-19: LGTM!

Also applies to: 66-90, 99-127

oshi-core/src/main/java/oshi/software/os/mac/MacOSFileStoreJNA.java (1)

7-7: LGTM!

Also applies to: 39-49

@dbwiddis
dbwiddis merged commit 10d81f7 into oshi:master Jul 26, 2026
17 checks passed
@dbwiddis
dbwiddis deleted the exceptionutil-varargs-catch-sweep branch July 26, 2026 23:11
dbwiddis added a commit that referenced this pull request Jul 28, 2026
* Clear the open SonarQube findings

Eight are fixed in code and ten are suppressed with an inline reason.

Fixed:

- S1128 x2: DxgiFFM and Shell32FFM extend ForeignFunctions and
  WindowsForeignFunctions respectively, so they inherit
  callInArenaOrDefault and the static import is redundant. Spotless
  cannot detect this because the bare name is textually referenced.
- S135 x2: restructure the SmcKeyIndex scan loop and
  parseConfiguredKeys as if/else. Behaviour is unchanged.
- S6353: write the GPU key mask as ^Tg\d[\dA-Za-z]$. Without
  UNICODE_CHARACTER_CLASS this is identical to the [0-9] form.
- S1192: SysctlFFM concatenated its failure message eagerly at all five
  call sites, formatting the sysctl name on every call whether or not it
  failed. Use the parameterized callInArena*OrDefault overloads with a
  single shared constant so the name is only formatted on failure.
- S1602: add the block-lambda guard comment to AdlUtilFFM.adlUninit,
  matching BStrFFM. Collapsing the block would reintroduce #3422.

Suppressed:

- S1168 x5: null and empty are different answers. Empty is a cacheable
  "this machine has no GPU temperature keys"; returning it after a
  failed read would cache the failure and disable GPU temperature for
  the lifetime of the JVM.
- S3077 x2: gpuTemperatureKeys is only ever assigned an unmodifiable
  copy of a completed discovery, so the volatile write safely publishes
  an immutable value. Memoizer carries the same suppression.
- S5786 x3: the module system only opens public types to the JUnit
  platform, so public on these test classes is required rather than
  redundant. SystemInfoTest carries the same suppression.

The four remaining S3776 findings are accepted in SonarCloud rather than
refactored. Three of them are an artifact of the ExceptionUtil and
callInArena conversions in #3528 and #3530: moving a method body into a
callInArenaOrDefault lambda adds a nesting level that Sonar scores,
without changing the logic.

* Do not report an unreadable SMC key block as a confirmed absence

findKeys distinguishes null ("could not read, ask again later") from an
empty list ("this machine has no such keys"), because the caller caches
the empty list and would otherwise disable the sensor for the lifetime
of the JVM. Two paths could reach empty after a failed read.

In the forward scan, readAny was satisfied by the key that ends the
block rather than by a match, so an index of [TB0T, Tg0f, Th00] whose
Tg0f is unreadable returned an empty list: the scan read Th00, set
readAny, and broke out having matched nothing.

In the binary search, probe substitutes a neighbouring key for an
unreadable one so a single bad index cannot abort discovery. That
substitution can move the landing point past the block, so for
[TB0T, TCMb, Tg0f, Th00] with Tg0f unreadable the scan never attempted
the only matching key, and no scan-side check could have caught it.

Track failed reads through a single wrapper around the lookup function
so both paths are covered, and return null when nothing matched and any
read failed. An empty result from a run with no failed read is still
returned and still cacheable, and a partial result is still returned,
so the existing skip-rather-than-stop behaviour is unchanged.

* Make the skipped-block test prove the scan never reached the key

testFailedSearchProbeThatSkipsTheBlockIsNotReportedAsAbsent failed the
sole matching index permanently, so a null result did not distinguish
the case it names -- the binary search substituting a neighbour and
landing past the block -- from the scan reaching that index and failing
both its reads. Both produce null.

Fail only the first read, which the search consumes. A null result now
proves the scan never attempted the index, because the scan retries once
and would have recovered Tg0f and returned a non-empty list. This also
separates the test from testFailedSoleMatchIsNotReportedAsAbsent, which
keeps a permanently failing index.
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