🟡 HIGH SEVERITY - Resource Leak
Severity: P1
Locations:
src/mcp-proxy-server.ts:283, 316
src/mcp-client-pool.ts:521, 724
src/redis-cache-provider.ts:190
Impact:
- Timers keep Node.js process alive
- Memory accumulation
- Graceful shutdown blocked
Examples:
// mcp-client-pool.ts:724
setTimeout(() => {
process.kill(pid, 'SIGKILL');
}, 2000);
// ← No clearTimeout, timer ID not stored
// redis-cache-provider.ts:190
this.cleanupInterval = setInterval(() => {
this.cleanup();
}, 60000);
// ← No clearInterval in disconnect/shutdown
Fix Pattern:
private timers: Set<NodeJS.Timeout> = new Set();
setTimeout(() => {...}, ms);
// Change to:
const timer = setTimeout(() => {...}, ms);
this.timers.add(timer);
async shutdown() {
for (const timer of this.timers) {
clearTimeout(timer);
}
this.timers.clear();
}
🟡 HIGH SEVERITY - Resource Leak
Severity: P1
Locations:
src/mcp-proxy-server.ts:283, 316src/mcp-client-pool.ts:521, 724src/redis-cache-provider.ts:190Impact:
Examples:
Fix Pattern: