Skip to content
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

Override 3 sec. WMI timeout in gopsutil #4268

Merged
merged 3 commits into from
May 9, 2018

Conversation

angrycub
Copy link
Contributor

@angrycub angrycub commented May 8, 2018

The default timeout is too short for some overburdened or resource constrained machines to complete the WMI query before the context deadline expires. This causes them to be unable to fingerprint the CPU properly.

The default timeout is too short for some overburdened or resource
constrained machines to complete the WMI query before the context
deadline expires.  This causes them to be unable to fingerprint the CPU
properly.
@angrycub angrycub requested a review from dadgar May 8, 2018 21:34
@@ -28,7 +35,9 @@ func Init() error {
}

var cpuInfo []cpu.InfoStat
if cpuInfo, err = cpu.Info(); err != nil {
ctx, _ := context.WithTimeout(context.Background(), cpuInfoTimeout)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the blank line


multierror "github.com/hashicorp/go-multierror"
"github.com/shirou/gopsutil/cpu"
)

const (
// We use this constant to override the built in 3 second timeout in gopsutil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cpuInfoTimeout is the timeout used when gathering CPU info. This is used to override the default timeout in gopsutil which has a tendency to timeout on Windows.

@angrycub angrycub merged commit 3212e38 into master May 9, 2018
@angrycub angrycub deleted the b-extend-win-cpu-fingerprint-timeout branch May 9, 2018 23:27
@github-actions
Copy link

github-actions bot commented Mar 4, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants