RFR: JDK-8185003 JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument

mandy chung mandy.chung at oracle.com
Fri Aug 4 14:38:42 UTC 2017


I haven't reviewed the change.  I will look at the new webrev next 
week.  I think this getThreadInfo method:

    getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers);

should allow specifying the maxDepth too.

Mandy


On 8/3/17 11:30 PM, Ujwal Vangapally wrote:
> Thanks for the review Daniel, Mandy, Roger, Erik.
>
> I will make changes accordingly and come up with new webrev soon.
>
> -Ujwal
>
>
> On 8/4/2017 5:42 AM, Mandy Chung wrote:
>>> On Aug 3, 2017, at 2:10 PM, Daniel Fuchs <daniel.fuchs at oracle.com> 
>>> wrote:
>>>
>>> Hi Mandy,
>>>
>>> On 03/08/17 21:04, Mandy Chung wrote:
>>>>> Adding a public method to an interface is an incompatible source 
>>>>> change unless there is a default body. On the other hand I am not 
>>>>> sure how MXBean proxies will work when proxying an interface 
>>>>> containing a default body. It would be interesting to check this.
>>>>>
>>>> ThreadMXBean is a platform MXBean and so JDK implementation is the 
>>>> one implementing it.  The real question here is that when 
>>>> MBeanServerConnection.invoke is called on this new method that does 
>>>> not exist in the remote MBeanServer (running on JDK 9 for example), 
>>>> does it get javax.management.ReflectionException?  Or something else?
>>> I believe that will be a ReflectionException:
>>> http://download.java.net/java/jdk9/docs/api/javax/management/MBeanServerConnection.html#invoke-javax.management.ObjectName-java.lang.String-java.lang.Object:A-java.lang.String:A- 
>>>
>>>
>>>> Similarly, when the client gets a proxy of ThreadMXBean from a 
>>>> remote MBeanServer running on JDK 9 VM, and it calls this method, 
>>>> what exception does it get?  We may need to update the spec to 
>>>> indicate this error cases if it’s not clear.  The notes in 
>>>> ManagementFactory.newPlatformMXBeanProxy covers some cases due to 
>>>> the difference in the client/server are running on.
>>> AFAIK that should be handled by the proxy code - I'd expect that you
>>> will get an UndeclaredThrowableException wrapping the 
>>> ReflectionException.
>>> http://hg.openjdk.java.net/jdk9/dev/jdk/file/65464a307408/src/java.management/share/classes/javax/management/MBeanServerInvocationHandler.java#l308 
>>>
>> Thanks. That’s what I think but need assurance. We should add tests 
>> to verify.
>>
>> Mandy
>



More information about the serviceability-dev mailing list