Skip to content

프로세스 누수 문제: 장시간 실행 시 orphan 프로세스 발생 #31

@wlgns5376

Description

@wlgns5376

🐛 문제 설명

장시간 실행 시 git, node, claude 프로세스가 정리되지 않고 남아있음

🔍 주요 원인

  1. Claude Developer (src/services/developer/claude-developer.ts:534-542)

    • 타임아웃 시 프로세스 그룹 전체가 종료되지 않음
    • bash -c 실행 시 하위 프로세스들이 orphan으로 남음
  2. Git Service (src/services/git/git.service.ts)

    • execAsync timeout 설정은 있지만 프로세스 정리 로직 없음

🛠️ 해결 방안

Claude Developer 개선 (핵심)

// 기존
child.kill('SIGTERM');

// 개선
child.kill('SIGTERM');
if (child.pid) {
  process.kill(-child.pid, 'SIGTERM'); // 프로세스 그룹 전체 종료
}

spawn 옵션 개선

const child = spawn('bash', ['-c', bashCommand], {
  // ...
  detached: false,
  killSignal: 'SIGTERM'
});

📝 할 일

  • Claude Developer 프로세스 그룹 종료 구현
  • Graceful shutdown 핸들러 추가
  • 테스트 케이스 작성

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions