Stuck creating task environment timeout and unstick path #46
Reference in New Issue
Block a user
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?
One fork PR: task environments stuck in status=creating with empty workspace_path block session launch forever (seen on c381cab0-c335-4ec4-9db7-9b232f7d8027 and 8e305cbc-92c2-4a19-b036-e7964f3bc20e; Kandev restart does not clear them). (1) Add a 10-minute timeout to workspace/environment preparation: a creating row older than 10 minutes is closed as failed and the next launch prepares a fresh environment, without stealing a preparation that a live owner is still actively running. (2) Add a supported operator path (admin API or tool) to release already-stuck creating rows. (3) Include the structural root-cause fix for repeated initial-launch failure (materialization owner abandons its own creating environment on route wait / shared-group rebind; diagnosis task 8574ed27-447c-4ffd-bc8d-d3c4c99271a2). Validate changed-package go test, go build, go vet and an isolated-instance check that a creating row past 10 minutes fails automatically and the retry prepares a new environment. Merge the fork PR (Conventional Commits, body cites only KANDEV-W-047) and report-progress. Source task f1510f3d-cbce-4b52-b423-ebdf2196279b. No common checkout writes, production Kandev or DB changes, upstream contact, hashes/fingerprints, or new standing tests.
KANDEV-W-047 creating-timeout change merged: fork PR #160 squashed as bf54b29c4a. Scope: 10m stale-creating timeout sweep pass wired to 1-min reconciliation tick with in-flight protection (live execution + atomic STARTING-RUNNING with executors_running row guard), shared-group pointer release, owner fail-fast on early launch failure, ResetTaskEnvironment creating-placeholder contract. Build/vet green; existing package tests reused; unapproved standing tests removed per review. Remaining: isolated-instance 10-min wall-clock confirmation and production stuck-row release are verification/operations follow-ups.
[KANDEV-W-047] creating 정체 해제 경로·격리 10분 확인 — 완료(검토 PASS). 한 일: (1) 10분 sweep creating_environment_reconciliation.go:17, (2) 운영자 해제 경로 POST /api/v1/tasks/:id/environment/reset -> ResetTaskEnvironment(service_task_environments.go:337), (3) 구조적 원인 수정이 모두 fork main에 이미 병합되어 있음을 코드로 판정. 격리 인스턴스(포트 48429, 격리 DB)에서 10분 초과 creating 행 자동 failed 회수, 10분 미만 보호, reclaim 재선출, reset API 행 삭제를 1회 실측. 근거: 이 작업은 신규 PR 없음 — 필요 경로가 기존 병합 PR #160(bf54b29c4a), #175(abd1f2001a), #176(8bafaa6b6c). 검토 head efff7d50f046f4743fe15090ba6260bd16351362 = 현재 HEAD. 검증: go test ./internal/task/service -run TestResetTaskEnvironment ok; go test ./internal/task/repository/sqlite -run TestReclaimFailedTaskEnvironmentMaterialization ok; go vet ./internal/task/...; go build ./cmd/kandev. 남은 것: 없음 — 운영 DB 멈춘 행 해제 실행은 운영 세션 몫(범위 밖). 후속 제안: 없음. 공용 체크아웃 쓰기 없음(대기열 카드 지침).