Skip to content

feat(uat): disposable profiles, retries, start limiter, SIGKILL sweeper - #22

Open
unohee wants to merge 1 commit into
masterfrom
feat/uat-batch-hardening
Open

unohee wants to merge 1 commit into
masterfrom
feat/uat-batch-hardening

Conversation

@unohee

@unohee unohee commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

무엇

  • procs.Sweeper: lyra-uat run/batch 가 SIGKILL 로 죽어도 자식 프로세스 그룹과 브라우저를 정리한다. 별도 세션의 작은 프로세스가 파이프 반대편을 잡고, 부모가 넘긴 그룹과 프로필 디렉터리를 기억한다. 파이프가 goodbye 없이 닫히면 그 그룹들과, --flag=<path> 인자가 감시 디렉터리 안을 가리키는 프로세스(Chrome --user-data-dir, crashpad --database)를 TERM 후 KILL 한다. 프로그램 이름으로는 절대 매칭하지 않으므로 운영자 본인의 Chrome 은 대상이 아니다. 정상 종료 시에는 아무것도 건드리지 않는다.
  • BatchSpec 새 키:
    • disposable_profiles: 시도마다 <batch>/profiles/ 아래 일회용 프로필 (seed 의 lock 파일 없는 복사본 또는 빈 프로필), 끝나면 삭제. 원본은 쓰지 않는다.
    • retries / retry_delay_s: 자식 crash 또는 browser_error·brain_error·harness_exit 일 때만 재시도. budget·wall clock·no finish 같은 페르소나 결과는 재시도하지 않는다. attempts 와 이전 실패 사유가 summary 에 남는다.
    • start_interval_s: 배치 전체의 자식 시작 간격 하한 (레이트리미터).
  • 재시도가 이전 시도의 report 를 자기 것으로 읽지 않도록 report fallback 검색에 시작 시각 조건 추가.
  • scripts/verify_uat_procs_e2e.py: 실제 Chrome 을 연 프로세스를 SIGKILL 하고 그 프로필을 가리키는 프로세스 수를 센다.
  • docs/UAT.md: SIGKILL 항목을 측정치로 교체, 배치 설정 표 추가.

왜

병렬 무인 실행에서 프로필 오염, 일시적 실패, 한꺼번에 몰리는 세션, 죽은 부모가 남긴 고아 Chrome 이 쌓인다. 이전 문서는 "lyra-uat run 이 SIGKILL 되면 아래는 아무것도 멈추지 않는다"고 적고 있었다.

검증

  • pytest -q: 1992 passed, 5 failed. 실패 5건(tests/uat/test_uat_llm_brains.py)은 이 venv 에 anthropic/openai SDK 가 없어서 나며, origin/master 에서도 똑같이 실패한다.
  • 새 테스트: test_uat_procs.py 3개 (SIGKILL 된 부모 → 하네스 그룹·자기 세션 "브라우저"·sweeper 모두 0개, 정상 종료 시 무접촉, 형제 경로 <dir>-other·위치 인자는 매칭 안 함), test_uat_batch.py 7개 (재시도·attempts, 페르소나 결과 비재시도, 레이트리미터 2개, 일회용 프로필 복사·삭제·원본 무손상, lock 파일 제외).
  • 실제 Chrome (scripts/verify_uat_procs_e2e.py --control, headless, 2026-11-15):
driver sweeper 있음 (3회) sweeper 없음 (대조)
native 11 → 0 (매회) 11 → 10 남음
playwright 10 → 0 (매회) 10 → 0 (드라이버 파이프가 닫히며 스스로 종료)

충돌 주의

같은 날 열리는 UAT PR 들과 docs/UAT.md, spec.py 를 같이 건드린다. 이 PR 의 추가분은 각각 별도 절과 별도 필드다.

…er for SIGKILL

A batch can now give every attempt a throwaway profile (a lock-free copy of
its data_dirs entry, or an empty one, deleted afterwards), retry a persona
whose child crashed or ended on a browser/brain/harness error, and space
child starts with start_interval_s.

lyra-uat run and batch hand their child groups and browser profile
directories to a sweeper: a process of its own session on the far end of a
pipe. When the pipe closes without a goodbye (the parent was SIGKILLed) it
stops those groups and every process whose --flag=<path> points into a
watched directory. It never matches by program name.

scripts/verify_uat_procs_e2e.py measures it on a real browser: 0 processes
left on the profile 10 s after SIGKILL on native and Playwright, against 10
of 11 left on native without the sweeper.

This branch has not been deployed

No deployments
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