Commit Graph
4 Commits
Author SHA1 Message Date
art22s 44f2ea7219 Fix: guard cursor navigation in client/server mode (see #3221) 2026-08-04 21:13:20 -04:00
yogendrarau ec157a9c30 processcount pid_max always 0, and status comparison uses is instead of == #3637
The status counting loop iterated over every key of the processcount dict, so
'pid_max' was assigned the number of processes whose status is 'pid_max', ie 0.
It was set to the system value on the line above, and 'total' and 'thread' are
recomputed after the loop, so pid_max was the only casualty: /api/4/processcount
reported 0 while /proc/sys/kernel/pid_max was 4194304.

The status was also matched with 'is', which compares identity. It only worked
by accident, because CPython interns identifier-like literals such as 'running'
and 'sleeping'. Any status that is not interned, or not an identifier such as
'disk-sleep', would never match its key.

Count the two status keys only, and compare with '=='. pid_max now keeps the
value read from the system, and stays None when it can not be read (non Linux),
as documented by the property and as initialised by reset_processcount().
2026-08-03 19:50:08 -04:00
Ambika Patidar 5eb1f4b794 test: Fix linting issues and trailing whitespace 2026-02-07 00:55:14 +05:30
Ambika Patidar 645841d99a Added test cases for plugins 2026-02-06 17:51:37 +05:30