Compare commits

...

2 Commits

Author SHA1 Message Date
f10a7847c2 5.10.1
Some checks failed
Default (tags) / security (push) Failing after 12m11s
Default (tags) / test (push) Has been cancelled
Default (tags) / release (push) Has been cancelled
Default (tags) / metadata (push) Has been cancelled
2025-09-03 08:27:06 +00:00
3a39fbd65f fix(processmonitor): Skip null pidusage entries when aggregating process-group memory/CPU to avoid errors 2025-09-03 08:27:06 +00:00
4 changed files with 16 additions and 4 deletions

View File

@@ -1,5 +1,12 @@
# Changelog
## 2025-09-03 - 5.10.1 - fix(processmonitor)
Skip null pidusage entries when aggregating process-group memory/CPU to avoid errors
- Add defensive check for null/undefined entries returned by pidusage before accessing memory/cpu fields
- Log a debug message when an individual process stat is null (process may have exited)
- Improve robustness of ProcessMonitor.getProcessGroupStats to prevent runtime exceptions during aggregation
## 2025-09-01 - 5.10.0 - feat(daemon)
Add crash log manager with rotation and integrate crash logging; improve IPC & process listener cleanup

View File

@@ -1,6 +1,6 @@
{
"name": "@git.zone/tspm",
"version": "5.10.0",
"version": "5.10.1",
"private": false,
"description": "a no fuzz process manager",
"main": "dist_ts/index.js",

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tspm',
version: '5.10.0',
version: '5.10.1',
description: 'a no fuzz process manager'
}

View File

@@ -435,8 +435,13 @@ export class ProcessMonitor extends EventEmitter {
let totalMemory = 0;
let totalCpu = 0;
for (const key in stats) {
totalMemory += stats[key].memory;
totalCpu += Number.isFinite(stats[key].cpu) ? stats[key].cpu : 0;
// Check if stats[key] exists and is not null (process may have exited)
if (stats[key]) {
totalMemory += stats[key].memory || 0;
totalCpu += Number.isFinite(stats[key].cpu) ? stats[key].cpu : 0;
} else {
this.logger.debug(`Process ${key} stats are null (process may have exited)`);
}
}
this.logger.debug(