Repository navigation
Wake the owner watch reader through a polled channel - #448
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: Fixes #446. The 30 s hang limits in the
process.rstests are in #434.Summary
A guarded child that had finished its work could stay alive on macOS under load, in the drop of its
OwnerWatch.The watch's reader waited in
readand relied on a socket shutdown or a 25 ms receive timeout to end; neither woke it.The reader now polls the owner channel and a wake channel together, and closing the watch wakes it by data and end of stream, then joins.
No time or socket-shutdown behavior is involved any more.
Review
LocalListener::accept와 같은 wake 채널 패턴)입니다.hide-platform/src/process.rs- owner 상실을 처리하는 reader의 failure path입니다.poll오류는 owner 상실(_exit(125))로 갑니다. 이전read오류와 같은 처리입니다.Evidence
closing_the_watch_wakes_a_reader_that_is_waiting_on_a_silent_owner: owner 끝이 연결된 채 조용한 상태에서 reader가 poll에 들어간 것을 확인한 뒤 watch를 닫고, join이 wake로 끝나는지 봅니다. 두 번 돌려 admission slot이 반환되는지도 봅니다. 순서는 테스트가 정하고 시간은 hang 한도로만 씁니다. 이 테스트는 한가한 기계에서는 수정 전 코드도 통과합니다(원인이 OS 동작이라서). 수정의 증거는 아래 부하 측정입니다.taskpolicy -b+yes4개, 주변 load 25-30) 하에서 같은 테스트를 수정 전/후 바이너리로 비교(8초 안에 안 끝나면 hang):only_a_guarded_launch_returns_startup_proof수정 전 2/120 hang, 수정 후 0/120.repeated_guarded_work_releases_children_and_capture_resources수정 전 2/100, 수정 후 0/100.guarded_capture_keeps_stdin...은 양쪽 0/100(재현되지 않은 항목).hide-platform전체,hide-host,hide-agent-hooks테스트,fmt-check,clippy -D warnings통과.process.rs테스트가 안정적인지는 #434와 이 PR이 둘 다 들어간 뒤에 봐야 합니다.