-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YARN-8246 winutils - fix failure to retrieve disk and network perf co… #458
Conversation
…unters on localized windows installlation PdhAddCounter expects performance counter path to be in the same language than the windows installation. With current code, the calls to PdhAddCounter will fail with error 0xc0000bb8 (PDH_CSTATUS_NO_OBJECT) on non-english windows installation. The solution is to use PdhAddEnglishCounter function instead https://docs.microsoft.com/en-us/windows/desktop/api/pdh/nf-pdh-pdhaddenglishcounterw "This function provides a language-neutral way to add performance counters to the query"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkstyle
@@ -161,25 +161,25 @@ int GetDiskAndNetwork(LONGLONG* diskRead, LONGLONG* diskWrite, LONGLONG* netRead | |||
} | |||
|
|||
// Add each one of the counters with wild cards | |||
if(status = PdhAddCounter(hQuery, COUNTER_PATH_NET_READ_ALL, 0, &hCounterNetRead)) | |||
if(status = PdhAddEnglishCounter(hQuery, COUNTER_PATH_NET_READ_ALL, 0, &hCounterNetRead)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(status = PdhAddEnglishCounter(hQuery, COUNTER_PATH_NET_READ_ALL, 0, &hCounterNetRead)) | |
if (status = PdhAddEnglishCounter(hQuery, COUNTER_PATH_NET_READ_ALL, 0, &hCounterNetRead)) |
{ | ||
fwprintf_s(stderr, L"PdhAddCounter %s failed with 0x%x.\n", COUNTER_PATH_NET_READ_ALL, status); | ||
ret = EXIT_FAILURE; | ||
goto cleanup; | ||
} | ||
if(status = PdhAddCounter(hQuery, COUNTER_PATH_NET_WRITE_ALL, 0, &hCounterNetWrite)) | ||
if(status = PdhAddEnglishCounter(hQuery, COUNTER_PATH_NET_WRITE_ALL, 0, &hCounterNetWrite)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(status = PdhAddEnglishCounter(hQuery, COUNTER_PATH_NET_WRITE_ALL, 0, &hCounterNetWrite)) | |
if (status = PdhAddEnglishCounter(hQuery, COUNTER_PATH_NET_WRITE_ALL, 0, &hCounterNetWrite)) |
{ | ||
fwprintf_s(stderr, L"PdhAddCounter %s failed with 0x%x.\n", COUNTER_PATH_NET_WRITE_ALL, status); | ||
ret = EXIT_FAILURE; | ||
goto cleanup; | ||
} | ||
if(status = PdhAddCounter(hQuery, COUNTER_PATH_DISK_READ_ALL, 0, &hCounterDiskRead)) | ||
if(status = PdhAddEnglishCounter(hQuery, COUNTER_PATH_DISK_READ_ALL, 0, &hCounterDiskRead)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(status = PdhAddEnglishCounter(hQuery, COUNTER_PATH_DISK_READ_ALL, 0, &hCounterDiskRead)) | |
if (status = PdhAddEnglishCounter(hQuery, COUNTER_PATH_DISK_READ_ALL, 0, &hCounterDiskRead)) |
{ | ||
fwprintf_s(stderr, L"PdhAddCounter %s failed with 0x%x.\n", COUNTER_PATH_DISK_READ_ALL, status); | ||
ret = EXIT_FAILURE; | ||
goto cleanup; | ||
} | ||
if(status = PdhAddCounter(hQuery, COUNTER_PATH_DISK_WRITE_ALL, 0, &hCounterDiskWrite)) | ||
if(status = PdhAddEnglishCounter(hQuery, COUNTER_PATH_DISK_WRITE_ALL, 0, &hCounterDiskWrite)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(status = PdhAddEnglishCounter(hQuery, COUNTER_PATH_DISK_WRITE_ALL, 0, &hCounterDiskWrite)) | |
if (status = PdhAddEnglishCounter(hQuery, COUNTER_PATH_DISK_WRITE_ALL, 0, &hCounterDiskWrite)) |
Hi jiwq, If I do the suggested format change, it will make the formatting inconsistent with the rest of file (there are plenty of "if" not followed by space in the rest of the file). I would prefer not mixing a functional change with a formatting change. Peter |
Hi @pgoron , I'm okay. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
…ducer Refactoring eventhub system producer into common reusable components 1. AsyncSystemProducer : All the system producers that have real async send API with call backs can use this 2. NoFlushAsyncSystemProducer: All the system producers that have real async call back based send API and doesn't provide flush semantics can use this. The system producers that implement AsyncSystemproducers can be used across Samza and Brooklin. TODO: AsyncSystemProducer needs to be moved to the api layer so that it can be used across different system producers (i.e. eventhub and kinesis) Author: Srinivasulu Punuru <spunuru@linkedin.com> Reviewers: Boris S <boryas@apache.org> Closes apache#458 from srinipunuru/async-prod.3
but where I use this function? I've the same problem to start hadoop: ExitCodeException exitCode=1: PdhAddCounter \Network Interface(*)\Bytes Received/Sec failed with 0xc0000bb8 Please help me! |
…-76130 (apache#491) * Revert "[hadoop] LIHADOOP-76132 : Evolve the BundledTokenIdentifier to include SPIFFE tokens (apache#458)" This reverts commit e3d76d0. * Revert "[hadoop] LIHADOOP-76131 : Create the SPIFFE Delegation Token Identifier (apache#456)" This reverts commit df81929. * Revert "[hadoop] LIHADOOP-76130: Update BundledDelegationTokenIdentifier to have unambiguous serde (apache#457)" This reverts commit 902ba08.
…unters on localized windows installlation.
PdhAddCounter expects performance counter path to be in the same language than the windows installation.
With current code, the calls to PdhAddCounter will fail with error 0xc0000bb8 (PDH_CSTATUS_NO_OBJECT)
on non-english windows installation.
The solution is to use PdhAddEnglishCounter function instead
https://docs.microsoft.com/en-us/windows/desktop/api/pdh/nf-pdh-pdhaddenglishcounterw
"This function provides a language-neutral way to add performance counters to the query"