summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2021-10-02 18:22:49 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2021-10-02 18:22:49 +0200
commit102a3dd115ef763920b7db0741d585155e8282ed (patch)
treebb70647affdabd1d0acb55e9c24f7267ef6f1433
parent29214fc820cb2c8ac062da8e9f99f3459f10f93c (diff)
downloadpsutil-102a3dd115ef763920b7db0741d585155e8282ed.tar.gz
give credits to @XuehaiPan for #1948, #1949
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
-rw-r--r--CREDITS4
-rw-r--r--HISTORY.rst8
-rw-r--r--psutil/_common.py4
3 files changed, 12 insertions, 4 deletions
diff --git a/CREDITS b/CREDITS
index c614c422..280c3b1c 100644
--- a/CREDITS
+++ b/CREDITS
@@ -758,3 +758,7 @@ D: fix typos in documentation
N: Pablo Baeyens
W: https://github.com/mx-psi
I: 1598
+
+N: Xuehai Pan
+W: https://github.com/XuehaiPan
+I: 1948
diff --git a/HISTORY.rst b/HISTORY.rst
index 4058d660..660467cd 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -17,16 +17,18 @@ XXXX-XX-XX
determined (instead of crashing).
- 1512_: [macOS] sometimes Process.connections() will crash with EOPNOTSUPP
for one connection; this is now ignored.
+- 1598_: [Windows] psutil.disk_partitions() only returns mountpoints on drives
+ where it first finds one
+- 1874_: [Solaris] swap output error due to incorrect range.
- 1892_: [macOS] psutil.cpu_freq() broken on Apple M1.
- 1904_: [Windows] OpenProcess fails with ERROR_SUCCESS due to GetLastError()
called after sprintf(). (patch by alxchk)
-- 1874_: [Solaris] swap output error due to incorrect range.
- 1913_: [Linux] wait_procs seemingly ignoring timeout, TimeoutExpired thrown
- 1921_: [Windows] psutil.swap_memory() shows committed memory instead of swap
+- 1948_: Process' memoize_when_activated decorator was not thread-safe. (patch
+ by Xuehai Pan)
- 1953_: [Windows] disk_partitions() crashes due to insufficient buffer len.
(patch by MaWe2019)
-- 1598_: [Windows] psutil.disk_partitions() only returns mountpoints on drives
- where it first finds one
5.8.0
=====
diff --git a/psutil/_common.py b/psutil/_common.py
index d5548d1c..2acab626 100644
--- a/psutil/_common.py
+++ b/psutil/_common.py
@@ -456,7 +456,9 @@ def memoize_when_activated(fun):
try:
self._cache[fun] = ret
except AttributeError:
- pass # inconsistency caused by multi-threading, just ignore it
+ # multi-threading race condition, see:
+ # https://github.com/giampaolo/psutil/issues/1948
+ pass
return ret
def cache_activate(proc):