RFR(M): JDK-8203321: Windows: assert(current_query_index < process_query_set->size) failed: invariant

Markus Gronlund markus.gronlund at oracle.com
Tue May 22 19:24:00 UTC 2018


Kindly asking for reviews for the following change:

Bug: https://bugs.openjdk.java.net/browse/JDK-8203321
Webrev: http://cr.openjdk.java.net/~mgronlun/8203321/webrev00/ 


For some context about what this is about, please see this (now) relatively old issue: https://bugs.openjdk.java.net/browse/JDK-8019921 

The porting work that brought this code from closed to open were optimistic in that the following PDH query,  "\Process(java#n)\ID Process", performed relatively stable on Windows 10.
An invariant was added in that your ID Process query would never return an index that was lower than the index at construction.

During testing, it was discovered that this invariant did not hold, especially when running on Windows Server 2012 R2 and there is a high churn rate with many processes with the same base name ("java#") starting and stopping (stressing PDH list of processes).

We have to reinsert back the original code that handled the case where the PDH process list is not stable (that were originally put in place with JDK-8019921).
The defensive logic is located at lines 418 - 422.

I had to rework some related code to make some room for this as well as to keep track of the previous process index.


More information about the hotspot-runtime-dev mailing list