KBI 311056 Issue Addressed: Windows Performance Rule Failed With PDH Error 0x102 When Using Dynamic Pool
Version
Argent Advanced Technology 3.1A-1407-A and later
Date
Tuesday, 2 Sep 2014
Summary
When running Windows Performance Rule in dynamic pool, the Rule can fail with PDH error 0x102 and no data is collected
The issue happens intermittently
It is directly related to how busy the system is
A typical error logged in trace log is shown as following:
This Microsoft bug has been circumvented in Argent AT 3.1A-1407-T3
Technical Background
Microsoft reveals the internals of PDH to be as following:
Basically PDH uses internal mutex to synchronize access
PDH is a top level wrapper around RegQueryValueEx(HKEY_PERFORMANCE_DATA, …)
Even though the application can create a query and add/monitor counters from multiple threads, we internally have a timeout to break the call
If PDH gets more than a single request (any PDH call) per process at a time, PDH implementation will block the second call until the first one completes
After 15 seconds the second call will time out with an error
PDH call will fail with 258 WAIT_TIMEOUT (The wait operation timed out.)
It is up to the application to recover from this error code when PDH is used from multiple threads
In other words, PDH is single threaded but is not documented as such
Argent AT 3.1A-1407-T3 has implemented the retry mechanism to recover from the Microsoft error
Resolution
Upgrade to Argent Advanced Technology 3.1A-1407-T3 or later
For customer who experiences such an issue and cannot upgrade immediately, he may use the Relator option ‘Spawn New Monitoring Engine Process‘ to avoid the issue
But as nothing in life is free, this can add additional load to the operating system