mirror of
https://github.com/NodeDaemon/NodeDaemon.git
synced 2026-04-27 08:15:55 +03:00
[PR #1] [MERGED] Find and fix a verifiable bug with tests #2
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/NodeDaemon#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/NodeDaemon/NodeDaemon/pull/1
Author: @ersinkoc
Created: 11/5/2025
Status: ✅ Merged
Merged: 11/5/2025
Merged by: @ersinkoc
Base:
main← Head:claude/identify-and-fix-bug-011CUoybhg5RCPhRPNAPvgXy📝 Commits (1)
05607e5fix: prevent duplicate instance creation on process restart📊 Changes
2 files changed (+361 additions, -4 deletions)
View changed files
📝
src/core/ProcessOrchestrator.ts(+104 -4)➕
tests/unit/restart-instance-bug.test.js(+257 -0)📄 Description
Fixes a critical bug in ProcessOrchestrator where restarting a crashed process would create duplicate instance objects instead of reusing the existing one.
Bug Description:
The
restartInstancemethod was callingstartClusterInstanceorstartSingleProcess, which create new ProcessInstance objects and push them to the instances array. This caused:Fix:
Refactored restart logic to spawn processes directly without creating new instances:
spawnClusterWorkerForInstance()helper methodspawnSingleProcessForInstance()helper methodrestartInstance()to reuse existing instance objectsImpact:
Testing:
Added comprehensive test suite in restart-instance-bug.test.js that verifies:
Location: src/core/ProcessOrchestrator.ts:333-466
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.