Repository navigation
Give hide browser a per-command budget for frames that never answer - #627
Merged
Merged
Conversation
A frame that left MISS_LIMIT rounds of one command unanswered is noted and not asked again for the rest of that command, so a permanently hung frame costs two steps, not one on every read. Every wait of a command is bounded by what the command has left, so wait reports timeout at its own deadline. The client counts commands the gateway still holds, including those it gave up on at its step, against the gateway's pending cap, so silent frames never end a read with browser_limit. A ref no readable frame carries, beside a frame that did not answer, says to take a fresh snapshot.
…t short The look for a frame's own frames shares the frame's budget of unanswered rounds, so a frame that goes silent after it answered is not scanned again and again. A wait whose last poll ended before the top document answered says so instead of reporting the text as not found, and nothing is sent when the command has no time left.
…topping a healthy call A frame that answers starts its budget again, and a look for its own frames that went unanswered waits for the next read instead of being repeated in the same call. The top document and input events are always sent; frame reads go in rounds that stay within the room the gateway has, the sessions not yet asked first, and a session that has not answered its last command is asked again only while few are held. Commands count as held until a message of the gateway's ends them, not by a guess at its clock. A frame whose own frames could not be listed is named in a snapshot, in a change check, where the frames inside it are left out of both texts, and in a wait. A wait's first poll is a whole read, and its interval counts only the sessions asked. The help error table and the docs match what the command returns.
…of the unread A miss is a round in which a frame was asked one kind of thing and gave no answer to it. A frame's look for its own frames is counted apart from its enable, tag and reads, so an answer to a read no longer starts the count of a look it never answers, and neither kind is cleared by the other. A call the gateway had no room for, or no time left for, is never sent and has its own outcome: the frame stays unread for that round, is not charged a miss, and is asked in a later round. A frame whose own frames could not be listed has been read: it keeps its section and refs, is compared normally and is not called unresponsive. The frames inside it are the unread ones, noted as unlisted, left out of both texts of a change check and named by a wait that times out.
…hat releases them The error answers that end what the gateway holds now precede the answer to the request that releases them on the socket, so a client that has read its answer has read them. Sent after it, they could still be in flight when the next read began, which made the held-command test depend on the scheduler.
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.
Closes #625
Summary
응답하지 않는 프레임이 읽기마다 한 step(8초)씩 비용을 내고,
wait가 timeout을 넘기고, 게이트웨이의 pending 상한을 넘길 수 있던 문제를 한 가지 원인으로 묶어 고쳤습니다.화면 변경은 없습니다.
hide browser의 동작과 도움말만 바뀝니다.MISS_LIMIT)이면 기록만 하고 그 명령이 끝날 때까지 다시 묻지 않습니다. 횟수는 요청 종류별로 셉니다(enable·tag·읽기 / 안쪽 프레임 찾기). 같은 종류의 답만 그 종류의 횟수를 처음부터 다시 시작합니다.NotSent로 따로 다루며, 프레임의 miss로 세지 않고 이번 라운드에만 unread로 남깁니다. 다음 라운드에 다시 묻습니다.# OOPIF unlisted origin=<origin>으로 표시됩니다. 프레임은 계속 unread로 이름이 불리고, 변경으로도 부재로도 세지 않습니다.mouseReleased포함)는 프레임 읽기가 차지한 자리 때문에 거절되지 않습니다. 프레임 읽기는 게이트웨이에 남은 자리 안에서 묶음으로 나가고, 아직 묻지 않은 세션이 먼저, 마지막 질문에 답하지 않은 세션은 나중에 나갑니다.wait의 첫 poll은 온전한 읽기이고, 이후 poll의 모든 읽기는 남은 시간으로 제한됩니다. 최상위 문서의 읽기가 deadline에 잘리면 "텍스트가 없다"가 아니라 "page가 답하기 전에 끝났다"고 말합니다.@tag:Nref는 여전히page_unresponsive이지만next_action이 새 snapshot을 찍으라고 안내하고, help의 오류표도 같은 말을 합니다.Review
wait에서 20초 뒤 살아난 프레임이 대표 사례). 한 번 더 묻는 시점(예:wait의 deadline 직전)을 두는 것은 후속으로 남겼습니다.ref_stale로 바꾸지 않고page_unresponsive+ 새 snapshot 안내로 뒀습니다. 침묵 프레임이 그 ref의 프레임이 아님을 알 방법이 없기 때문입니다.hided/src/browser_page/cdp.rs- failure path와 고빈도 경로:call_all의admit(상한 28/16, 최상위 우선)과 pending 맵. 대기하지 않고, 못 보낸 호출은 무응답으로 읽힙니다.hided/src/browser_page/page.rs-eval/eval_all/scan의 연속 miss 계산과unreadable()(자기 프레임을 찾지 못한 프레임도 noted).admit이 한 번 pending을 훑습니다(최대 32). 상시 작업이 아닙니다.Evidence
wait의 첫 poll이 짧은--timeout을 무시하는 점, 단일 호출이 게이트웨이 pending 상한에서 면제인 점. 리드가 별도 이슈로 올립니다.ad58abad에서verify와Design contract가 모두 통과했습니다(Rust workspace, remote mailbox, Linux·Windows OS contract, Windows check, Linux web e2e 4샤드, Windows e2e). 재실행은 없었습니다.scripts/verify-cargo.sh lint(fmt + clippy-D warnings) 통과. head83408fed의hidedlib 250개 통과,browser_page59개 통과.a_frame_that_answers_reads_but_not_the_look_for_its_own_frames_is_given_up_for_that_look,a_call_the_gateways_room_kept_back_is_not_a_miss_and_is_made_once_the_held_commands_end,a_frame_read_in_both_reads_is_compared_and_the_frames_inside_it_that_could_not_be_listed_are_not,a_frame_whose_own_frames_could_not_be_listed_keeps_its_section_and_is_not_called_unresponsive), 결함을 넣으면 각각 실패합니다(어떤 답이든 횟수 초기화, 보내지 않은 호출을 miss로 셈, 안 나열된 프레임 자신을 비교에서 뺌). 두 번째 건은recording_held로 게이트웨이가 쥔 명령을 테스트가 정한 순서에 끝내므로 시간에 기대지 않습니다. 첫 번째 건의 경과 시간 단언은 TESTING.md의 규칙(짧은 시계 한도 금지) 때문에 넣지 않고setAutoAttach횟수로 대신했습니다.codesign이internal error in Code Signing subsystem으로 실패해,hided/tests/connect_build.rs의 3개 테스트가 로컬에서 실패했습니다(직접codesign을 실행해도 같은 오류). 이 변경이 닿지 않는 코드이고 직전 head에서는 같은 머신에서 통과했으며, CI 결과로 확인합니다.fake_gateway.rs의 스크립트 게이트웨이로 옮겼고, 시간이 아니라 순서와 횟수로 판정합니다. 게이트웨이 모델은 33번째 명령에서 1013으로 닫고, 답 없는 명령에는 자기 deadline에 오류 답을 보냅니다.desktop/e2e/browser-agent.spec.ts의 "never answers" 시나리오)는 이 머신에서 실행하지 않았습니다. 네이티브 앱이 필요합니다.frames()에서 부모 재스캔)은 직접 테스트가 없습니다. 같은 호출 안에서 다시 보내지 않는 것을 코드(scanned_now)로 보장하고, 호출을 넘는 횟수는setAutoAttach가 2번을 넘지 않는 테스트로 봅니다.리뷰 항목별 처리
a_frame_that_answers_starts_its_budget_again.a_wait_shorter_than_a_read_still_gets_one_whole_read,a_polls_reads_after_the_first_end_with_the_wait_and_say_the_text_is_not_known_absent.frames_that_answer_are_read_beside_frames_the_gateway_still_holds_commands_of.a_drag_ends_with_its_release_whatever_the_gateway_holds_of_frame_reads,the_top_document_is_asked_when_frame_reads_have_filled_their_room.compare는 그 프레임과 안쪽 프레임을 양쪽 텍스트에서 뺍니다(Composite.lineage). 테스트:a_look_for_a_frames_own_frames_that_went_unanswered_...,frames_inside_a_frame_one_read_could_not_list_are_left_out_of_both_texts.frames()호출에서 이미 본 부모는 다시 스캔하지 않습니다(scanned_now).a_poll_counts_only_the_frames_it_asks.page_unresponsive행이 새 snapshot 안내를 말합니다.