8000 PdhValidatePath unexpected errors · Issue #49 · lxn/win · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
PdhValidatePath unexpected errors #49
Open
@jwenz723

Description

@jwenz723

I am working on building a pdh exporter for prometheus. Currently when my application initiates it calls the win.PdhValidatePath() function approximately 3000 times. Most of the calls succeed, however, some fail inconsistently.

I've discovered that the errors that are occurring are the following:

  • "The system could not find the environment option that was entered."
  • "The data area passed to a system call is too small.")
  • "There are no more files."
  • "Access is denied."

For all pdh counters that result in the errors above, if I try to collect them individually then no errors occur. The errors only occur when large amounts of pdh counters are using the PdhValidatePath() function. I do not have the PdhValidatePath() function inside of a Go routine, so concurrency should not be the problem here.

Any ideas on how to fix this? One solution I found online that wasn't officially answered suggested using the PdhValidatePathEx function rather than PdhValidatePath.

Thought I'd ask here before going down that path in case I am doing something wrong. If you want to see my code, it can be seen here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0