Skip to content

Review fixes for oshi:javaagent#17594

Open
otelbot[bot] wants to merge 1 commit intomainfrom
otelbot/code-review-oshi-javaagent
Open

Review fixes for oshi:javaagent#17594
otelbot[bot] wants to merge 1 commit intomainfrom
otelbot/code-review-oshi-javaagent

Conversation

@otelbot
Copy link
Copy Markdown
Contributor

@otelbot otelbot bot commented Apr 6, 2026

Summary

Applied 1 safe fix in instrumentation/oshi/javaagent to narrow optional-startup failure handling in OshiMetricsInstaller without changing module behavior when OSHI is absent or incompatible.

Applied Changes

General

File: OshiMetricsInstaller.java:35
Change: Replaced catch (Throwable) with catch (ReflectiveOperationException \| LinkageError) in afterAgent().
Reason: The review checklist's correctness and safety rules call for avoiding overly broad exception handling; this keeps optional OSHI activation failures ignored while no longer swallowing unrelated fatal JVM errors.


Download code review diagnostics

Automated code review of instrumentation/oshi/javaagent.
@otelbot otelbot bot requested a review from a team as a code owner April 6, 2026 04:06
Method getCurrentPlatformEnumMethod = getCurrentPlatformMethod(oshiSystemInfoClass);
getCurrentPlatformEnumMethod.invoke(null);
} catch (Throwable ex) {
} catch (ReflectiveOperationException | LinkageError exception) {
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.

should be ClassNotFoundException instead of LinkageError?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant