Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard against InaccessibleObjectException in ExecutorServiceMetrics #2452

Merged
merged 1 commit into from Feb 17, 2021

Commits on Feb 17, 2021

  1. Guard against InaccessibleObjectException in ExecutorServiceMetrics

    This is an issue with our current implementation for getting at the wrapped ThreadPoolExecutor in some types returned by Executors, when --illegal-access=deny is set. This is the default from Java 16. Without these changes, an uncaught exception is thrown when trying to perform the reflective access on binding ExecutorServiceMetrics with one of the private type ExecutorService in Executors.
    
    With these changes, the exception will be caught and logged. We end up catching all RuntimeExceptions since we cannot use the InaccessibleObjectException type introduced in Java 9, but this is probably fine in this implementation anyways.
    
    Resolves micrometer-metricsgh-2447
    shakuzen committed Feb 17, 2021
    Copy the full SHA
    668c053 View commit details
    Browse the repository at this point in the history