Skip to content

Serialize issue lifecycles in the job queue#16

Merged
vkehfdl1 merged 3 commits intomainfrom
feature/issue-serial-queue
Apr 6, 2026
Merged

Serialize issue lifecycles in the job queue#16
vkehfdl1 merged 3 commits intomainfrom
feature/issue-serial-queue

Conversation

@vkehfdl1
Copy link
Copy Markdown
Contributor

@vkehfdl1 vkehfdl1 commented Apr 5, 2026

Summary

  • 한 이슈의 lifecycle(implementation → review_round → ... → final_verdict)이 완료될 때까지 다른 이슈의 branch-touching 작업을 대기시키도록 RepoQueueManager를 리팩토링
  • Branch를 안 건드리는 stage(dev_sync, issue_request, issue_followup)는 lock 없이 즉시 실행
  • Handler 예외, _after_job 예외 시에도 issue lock이 영구 잠금되지 않도록 방어 로직 추가
  • join_all()에서 flush되지 않은 deferred job이 있으면 warning 로그 출력

Test plan

  • test_different_issues_serialized — 다른 이슈의 impl이 인터리브되지 않는지 검증
  • test_dev_sync_bypasses_issue_lock — dev_sync가 lock을 bypass하는지 검증
  • test_issue_request_not_locked — issue_request가 lock 없이 실행되는지 검증
  • test_failed_job_releases_lock — 실패한 job이 lock을 해제하는지 검증
  • test_handler_exception_releases_lock — handler 예외 시 lock 해제 검증
  • test_deferred_jobs_requeued_on_terminal — terminal 후 deferred jobs 재투입 검증
  • test_join_all_warns_on_orphaned_deferred_jobs — orphan deferred 경고 검증
  • 전체 테스트 76/76 통과

🤖 Generated with Claude Code

vkehfdl1 and others added 3 commits April 5, 2026 23:40
The FIFO queue allowed interleaved execution across issues, risking
branch contamination on the single repo checkout. Now branch-touching
stages (implementation, review_round, final_verdict, merge_conflict_resolution)
acquire a per-repo issue lock; jobs for other issues are deferred until
the active issue reaches final_verdict or fails. Non-branch stages
(dev_sync, issue_request, issue_followup) bypass the lock entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
If _run_job propagates an unexpected exception (e.g. storage failure on
the success path), the worker now catches it, marks job.status as failed,
and always runs _after_job via try/finally so the active-issue lock is
released and deferred jobs are not stranded.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
If _after_job raises (e.g. queue.put fails during flush), the worker
now catches the exception, logs it, and force-releases the active issue
lock so the repo is not permanently blocked.

join_all() now checks for deferred jobs that were never flushed and
logs a warning, making silent job loss visible.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vkehfdl1 vkehfdl1 merged commit d46bace into main Apr 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant