[상류] 기존 #4734 pprof listener 종료 누락 수정 #215

Closed
opened 2026-10-29 20:25:01 +09:00 by dreampiler · 3 comments
Owner

원 요구·승인

소유자 직접 지시(2026-10-29): 닫힌 #4393·#4396 리뷰 9건을 대체 PR·현재 코드와 대조해 누락된 수정은 검증 후 기존 PR에 반영, 기존 기능·이력 보존, 중복 PR 0. 이 task는 그중 #4396 review 4236867413(pprof listener 종료 누락)의 단일 source writer다. 8e 확인: Native task·p320에 #4734의 활성 writer 없음. P27 wrapper 145ee9fe는 이력 대조용 포인터일 뿐이며, 그 wrapper의 Plan을 고치거나 금지된 행동을 대신하지 않는다.

입력 (운영root 확인)

kdlbs/kandev#4734 'feat(agentctl): add optional loopback profiling listener' OPEN, 공개 head 95e1786c3fd1f4f87a9a167cea7fc235b4bfcc16, fork branch codex/upstream-agentctl-profiling-20261023. 그 commit의 cmd/agentctl/pprof_listener.go에서 startPprofListenerIfEnabled가 http.Server를 local 변수로만 만들고 goroutine ListenAndServe를 시작하며, Shutdown/Close나 owner 반환이 없다(운영 사본 f742도 같다). 현재 upstream main에는 이 파일이 없다. 그러니 '#4734에 기능이 있다'만으로 옛 review가 해결됐다고 보지 않는다.

할 일

  1. 자기 Native 새 사본에서 fork branch 공개 head 95e1786c를 가져온다(공용 checkout·운영 사본 쓰기 0).
  2. 실제 agentctl 진입점에서 listener가 종료 시 닫히지 않는 것(포트 점유·goroutine 잔류)을 좁게 재현한다.
  3. 최소 수정: 기존 agentctl context/server lifecycle에 listener 종료를 연결한다(기존 패턴대로 cleanup/stopper 반환 등). 기본(미설정)이면 추가 listener 0, loopback 제약, 기존 HTTP auth, bind 실패는 warning만, 기존 daemon 동작 불변. 자기가 만든 listener/worker만 close·wait한다.
  4. 관련 기존 cmd/agentctl test 파일에 최소 lifecycle case(닫힘·포트 해제·실패 처리)를 넣는다. 격리 localhost:0과 자기 임시 process만 쓴다. 새 test 파일·framework 0.
  5. 상류 pr-docs.cjs validateCoverage를 PR 전체 diff로 확인한다(missing이면 #4734의 기존 work order에 연결). normal hooks, 바뀐 delta만 gate workflow rv-run.
  6. 첫 재현 결과와 검토된 head를 8e/current 96e9d7f4-0840-479a-b7b6-3e18d45b4da4에 각 1회. 공개는 93→5d가 같은 #4734를 비강제 갱신한다. push/PR/댓글 0. 새 profiling PR 0.

경계

기존 95e 이력 보존, force/reset/amend/branch 삭제 0. 실행 중인 다른 프로세스·운영 pprof 설정·운영 사본 변경 0. 운영/DB/설치/프로필/재시작 0.

## 원 요구·승인 소유자 직접 지시(2026-10-29): 닫힌 #4393·#4396 리뷰 9건을 대체 PR·현재 코드와 대조해 누락된 수정은 검증 후 기존 PR에 반영, 기존 기능·이력 보존, 중복 PR 0. 이 task는 그중 #4396 review 4236867413(pprof listener 종료 누락)의 단일 source writer다. 8e 확인: Native task·p320에 #4734의 활성 writer 없음. P27 wrapper 145ee9fe는 이력 대조용 포인터일 뿐이며, 그 wrapper의 Plan을 고치거나 금지된 행동을 대신하지 않는다. ## 입력 (운영root 확인) kdlbs/kandev#4734 'feat(agentctl): add optional loopback profiling listener' OPEN, 공개 head 95e1786c3fd1f4f87a9a167cea7fc235b4bfcc16, fork branch codex/upstream-agentctl-profiling-20261023. 그 commit의 cmd/agentctl/pprof_listener.go에서 startPprofListenerIfEnabled가 http.Server를 local 변수로만 만들고 goroutine ListenAndServe를 시작하며, Shutdown/Close나 owner 반환이 없다(운영 사본 f742도 같다). 현재 upstream main에는 이 파일이 없다. 그러니 '#4734에 기능이 있다'만으로 옛 review가 해결됐다고 보지 않는다. ## 할 일 1. 자기 Native 새 사본에서 fork branch 공개 head 95e1786c를 가져온다(공용 checkout·운영 사본 쓰기 0). 2. 실제 agentctl 진입점에서 listener가 종료 시 닫히지 않는 것(포트 점유·goroutine 잔류)을 좁게 재현한다. 3. 최소 수정: 기존 agentctl context/server lifecycle에 listener 종료를 연결한다(기존 패턴대로 cleanup/stopper 반환 등). 기본(미설정)이면 추가 listener 0, loopback 제약, 기존 HTTP auth, bind 실패는 warning만, 기존 daemon 동작 불변. 자기가 만든 listener/worker만 close·wait한다. 4. 관련 기존 cmd/agentctl test 파일에 최소 lifecycle case(닫힘·포트 해제·실패 처리)를 넣는다. 격리 localhost:0과 자기 임시 process만 쓴다. 새 test 파일·framework 0. 5. 상류 pr-docs.cjs validateCoverage를 PR 전체 diff로 확인한다(missing이면 #4734의 기존 work order에 연결). normal hooks, 바뀐 delta만 gate workflow rv-run. 6. 첫 재현 결과와 검토된 head를 8e/current 96e9d7f4-0840-479a-b7b6-3e18d45b4da4에 각 1회. 공개는 93→5d가 같은 #4734를 비강제 갱신한다. push/PR/댓글 0. 새 profiling PR 0. ## 경계 기존 95e 이력 보존, force/reset/amend/branch 삭제 0. 실행 중인 다른 프로세스·운영 pprof 설정·운영 사본 변경 0. 운영/DB/설치/프로필/재시작 0.
Author
Owner

8e receiving acceptance: ACCEPT the #4734 pprof listener shutdown fix for closed #4396 review 4236867413 (task 35316114-72a2-40fe-ae97-c539943aca3a, single writer). 8e read-only checks: worktree kandev-upstream-4734_g8psfxqy HEAD 2ab1a10f09f9645601cb4a51494f3fca1471e0fb, descendant of the public #4734 head 95e1786c3fd1 (non-force FF possible), 3 files: cmd/agentctl main.go, pprof_listener.go, and the existing main_test.go (no new test file). Behaviour per source and root read: startPprofListenerIfEnabled now returns a stop function that the run path defers; it closes only its own server (sync.Once, srv.Close) and waits for the serve goroutine; default off, loopback-only, warning-only bind failure and auth unchanged. Formal RV FORMAL-rv-run-delta-2ab1a10f09f.md-1793275946865752700-10856-mid-1 (CALL-20261029-4da2b7da2786) completed APPROVE findings 0 (8e read the record). Source-reported: profiling and existing liveness cases pass including port rebind, repeated stop, noop and bind failure; gofmt/vet/lint 0; normal hooks; full-PR docs coverage covered. Two Windows CLI shim failures in the full package also fail on public 95e and are not claimed green. No push/comment. Publication: 93->5d non-force FF of the same #4734 to 2ab1a10f09f9, then answer and resolve the old #4396 thread only after public readback.

8e receiving acceptance: ACCEPT the #4734 pprof listener shutdown fix for closed #4396 review 4236867413 (task 35316114-72a2-40fe-ae97-c539943aca3a, single writer). 8e read-only checks: worktree kandev-upstream-4734_g8psfxqy HEAD 2ab1a10f09f9645601cb4a51494f3fca1471e0fb, descendant of the public #4734 head 95e1786c3fd1 (non-force FF possible), 3 files: cmd/agentctl main.go, pprof_listener.go, and the existing main_test.go (no new test file). Behaviour per source and root read: startPprofListenerIfEnabled now returns a stop function that the run path defers; it closes only its own server (sync.Once, srv.Close) and waits for the serve goroutine; default off, loopback-only, warning-only bind failure and auth unchanged. Formal RV FORMAL-rv-run-delta-2ab1a10f09f.md-1793275946865752700-10856-mid-1 (CALL-20261029-4da2b7da2786) completed APPROVE findings 0 (8e read the record). Source-reported: profiling and existing liveness cases pass including port rebind, repeated stop, noop and bind failure; gofmt/vet/lint 0; normal hooks; full-PR docs coverage covered. Two Windows CLI shim failures in the full package also fail on public 95e and are not claimed green. No push/comment. Publication: 93->5d non-force FF of the same #4734 to 2ab1a10f09f9, then answer and resolve the old #4396 thread only after public readback.
Author
Owner

8e publication acceptance: the pprof listener shutdown fix is published on the existing kdlbs/kandev#4734 by sole publisher 5d as a non-force fast-forward. 8e gh readback: OPEN, MERGEABLE, head 2ab1a10f09f9645601cb4a51494f3fca1471e0fb = reviewed head accepted in artifact-note:20261029T122016052546Z. 93 readback: base main, 7 files +313/-0; closed #4396 thread PRRT_kwDOQ2-eWs6rCG4- resolved with reply 4412246665, which states the fix is in the pending #4734 and not yet merged; exact-head check-runs 12 (5 queued, 7 completed/skipped, 0 failed), new-head docs coverage not yet reported, so no PASS claim. Not a whole-CI-green or merge claim. Maintainer review and merge remain external.

8e publication acceptance: the pprof listener shutdown fix is published on the existing kdlbs/kandev#4734 by sole publisher 5d as a non-force fast-forward. 8e gh readback: OPEN, MERGEABLE, head 2ab1a10f09f9645601cb4a51494f3fca1471e0fb = reviewed head accepted in artifact-note:20261029T122016052546Z. 93 readback: base main, 7 files +313/-0; closed #4396 thread PRRT_kwDOQ2-eWs6rCG4- resolved with reply 4412246665, which states the fix is in the pending #4734 and not yet merged; exact-head check-runs 12 (5 queued, 7 completed/skipped, 0 failed), new-head docs coverage not yet reported, so no PASS claim. Not a whole-CI-green or merge claim. Maintainer review and merge remain external.
Author
Owner

RV 승인(APPROVE, 필수 지적 0) 완료. 검토 단계 전환 신호가 이미 계획 칸에 기록되어 있어, 턴 종료 시 deferred move가 적용되면 검토 칸에서 완료 신호를 보내겠습니다. 공개 갱신은 93→5d 담당이며 이 소스는 push/PR/댓글 0입니다.

RV 승인(APPROVE, 필수 지적 0) 완료. 검토 단계 전환 신호가 이미 계획 칸에 기록되어 있어, 턴 종료 시 deferred move가 적용되면 검토 칸에서 완료 신호를 보내겠습니다. 공개 갱신은 93→5d 담당이며 이 소스는 push/PR/댓글 0입니다.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dreampiler/kandev#215