You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Sometimes i get an error when i want to get the io counters. But just sometimes...
"Cannot change thread mode after it is set."
To Reproduce
parts, err:=disk.Partitions(false)
for_, part:=rangeparts {
u, errUsage:=disk.Usage(part.Mountpoint)
iferrUsage!=nil {
logger.Error.Println(errUsage)
continue
}
counters, errIO:=disk.IOCounters(part.Mountpoint)
iferrIO!=nil {
=>logger.Error.Println(errIO)
"Cannot change thread mode after it is set."....
Expected behavior
[A clear and concise description of what you expected to happen.]
Environment (please complete the following information):
Windows: [Windows Server 2012R2]
Linux: [paste contents of /etc/os-release and the result of uname -a]
Mac OS: [paste the result of sw_vers and uname -a
FreeBSD: [paste the result of freebsd-version -k -r -u and uname -a]
OpenBSD: [paste the result of uname -a]
The text was updated successfully, but these errors were encountered:
Lomanic
changed the title
Cannot change thread mode after it is set.
"Cannot change thread mode after it is set." error when calling disk.IOCounters on Windows
Dec 14, 2018
Solution is probably to remove calls to WMI (see #692 (comment)), performance counters might be an option here but way less easy to request than wmi (thanks to stackexchange/wmi package). Here is an example in Python, here is a promising package in Go.
Describe the bug
Sometimes i get an error when i want to get the io counters. But just sometimes...
"Cannot change thread mode after it is set."
To Reproduce
Expected behavior
[A clear and concise description of what you expected to happen.]
Environment (please complete the following information):
/etc/os-release
and the result ofuname -a
]sw_vers
anduname -a
freebsd-version -k -r -u
anduname -a
]uname -a
]The text was updated successfully, but these errors were encountered: