RFR: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently [v3]

Alan Bateman alanb at openjdk.org
Fri Nov 24 11:43:04 UTC 2023


On Fri, 24 Nov 2023 06:54:27 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Right now, the sole usage of the `monitoredHostServiceLoader` instance is within a `synchronized (monitoredHosts) {...}` block within a method. So it wouldn't require this `assert`.

Okay, I guess part of me wonders why this field is needed in the first place. Why can't getMonitoredHost just create a ServiceLoader instead instead of trying to share between threads?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16805#discussion_r1404261936


More information about the serviceability-dev mailing list