forked from micrometer-metrics/micrometer
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
2 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters