Skip to content

Finish a Factory CI verification whose check runs outgrow the node's output cap - #891

Merged
yansfil merged 3 commits into
mainfrom
fix/factory-verify-stuck
Oct 9, 2026
Merged

yansfil merged 3 commits into
mainfrom
fix/factory-verify-stuck

Conversation

@yansfil

@yansfil yansfil commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

CI가 초록인데 Factory Task가 검증 중에서 끝나지 않던 원인을 고칩니다 (운영 Factory의 T-1 #872, T-2 #873).
check-runs 읽기가 run 전체(하나에 약 3.5 KB)를 받았고, node는 명령 출력을 64 KiB까지만 남깁니다.
check run이 20개인 PR은 답이 약 71 KB라 잘렸고, 잘린 JSON은 파싱에 실패했습니다. CI poll은 신호 없는 오류를 pending으로 읽었고, 2초 tick마다 다시 물었습니다.

  • 읽기는 gh api --paginate ... --jq '.check_runs[] | {name, status, conclusion, html_url}'로 run마다 한 줄(약 180 B)만 받습니다.
  • 결정을 못 낸 읽기는 오류를 포함해 30초 간격으로만 다시 묻습니다.
  • 읽지 못한 답은 새 poll 결과 Unread입니다. 아무것도 결정하지 않고 실패로 세지 않으며, 한 run에서 세 번째면 Task에 notice를 남깁니다.
  • restart가 검증을 다시 시작할 때 앞에 남은 미완료 attempt를 cancelled로 닫습니다 (T-2처럼 running이 둘 남은 기록).
  • 작은 결함: hide factory config의 답에 settable(disk_floor_gb 같이 --set이 받는 키와 단위)을 더하고, 모르는 키는 그 키와 받는 키 전체를 말하며 거절합니다.
commit fc92b0a6 (#873)  전체 답 71100 B -> 투영 3507 B, 20줄, verify completed/success
commit dd0c5c55 (#872)  전체 답 70760 B -> 투영 3507 B, 20줄, verify completed/success

Review

  • 판단해 주세요: 읽지 못한 답이 세 번이면 notice(확인만). Task를 멈추지 않는 것이 맞는지. 다시 읽히면 그대로 끝납니다.
  • 판단해 주세요: config 답은 저장 레코드(config, ms/bytes)를 그대로 두고 settable을 덧붙였습니다. web 설정 화면이 config.disk_floor_bytes를 읽어 이름을 바꾸지 않았습니다.
  • 조심해서 볼 파일: hide-factory/src/project.rs - failure path. 오류도 ci_pending 간격을 타므로 main check의 오류 다음 30초는 Pending으로 답합니다.
  • 조심해서 볼 파일: hide-node-link/src/factory.rs - node가 만드는 gh 명령 줄. 이전 node가 답한 전체 JSON 한 줄은 run이 아니어서 Unread로 읽힙니다 (잘못된 pass가 아님).
  • 비용 검토: tick당 일이 줄었습니다. 막힌 Task 하나가 2초마다 71 KB를 받던 것이 30초마다 3.5 KB입니다. run이 100개를 넘으면 한 읽기에 page가 늘어납니다.

Evidence

  • 확인한 것: 운영 기록(읽기 전용)에서 두 Task가 verify.started 뒤 verify.finished 없이 7시간, 두 PR의 required verify는 success.
  • 확인한 것: 실제 gh로 위 두 commit의 전체 답이 64 KiB를 넘고, 새 명령의 답은 3507 B로 verify success를 담는 것.
  • 확인한 것: github::a_commit_with_many_check_runs_passes_on_its_named_check - node의 64 KiB 자르기를 흉내 낸 fake gh에서 3.5 KB run 20개가 Passed.
  • 확인한 것: engine::an_unread_verification_answer_is_asked_again_and_told_to_a_person, engine::a_task_stuck_verifying_with_two_unfinished_attempts_concludes_after_a_restart, github::an_unreadable_check_answer_is_unread_and_asked_again_at_its_pace, engine::config_prints_each_setting_under_the_key_set_takes_and_names_a_refused_key.
  • 확인한 것: verify-cargo.sh lint, hakari, workspace nextest, scripts/tests 319개, check-core-touches-no-machine, check-no-attribution, check-no-workstation-identity 통과.
  • 확인하지 못한 것: 격리 HOME과 Herdr, 연습 저장소로 Factory 전체를 돌린 live check는 하지 않았습니다. check run 20개 이상인 연습 GitHub 저장소가 없어서, 실제 gh 답과 fake 경로로 나눠 확인했습니다.
  • 확인하지 못한 것: 운영 T-1, T-2는 이 build가 설치되어 hided가 다시 시작해야 끝납니다 (restart가 검증을 다시 시작하고 새 읽기가 Passed). 설치는 하지 않았습니다.
  • 확인하지 못한 것: contracts/hide-cli.json에는 factory 명령이 없어 바꿀 것이 없었습니다.
  • 후속: 같은 64 KiB 자르기는 다른 읽기에도 걸립니다. JSON 읽기(LabelledIssues 200개 본문 등)는 external.failed로 드러나지만, git diff --name-only(risk path)는 잘려도 조용합니다. 이슈로 따로 남기는 게 좋겠습니다.

The check-runs read asked GitHub for whole runs, about 3.5 KB each, and
the node keeps 64 KiB of a command's output, so a pull request with
twenty check runs got a cut answer that failed to parse; the CI poll
read that signal-less error as pending and asked again every tick, and
the Task stayed verifying with its required check green.

The read now keeps only name, status, conclusion and link per run with
--paginate, an undecided read waits out the poll interval, and an
unreadable answer is its own poll outcome: it decides nothing, and the
third one in a run leaves a notice on the Task.
A run sent back to its worker by an older build kept its attempt open,
so a Task reported again carried two attempts shown as running. The
restart that starts the last one again now closes every earlier
unfinished attempt as cancelled, since nothing will answer it.
hide factory config printed the disk floor as disk_floor_bytes while
--set takes disk_floor_gb, and a key --set does not take was refused
with only config_invalid. The answer now carries settable, each setting
the record keeps in another unit under its --set key and unit, and an
unknown key is refused naming it and every key --set takes.
@yansfil
yansfil merged commit 8b20910 into main Oct 9, 2026
20 checks passed
@yansfil
yansfil deleted the fix/factory-verify-stuck branch October 9, 2026 17:53
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