Repository navigation
fix: start a device's PowerShell without scanning every installed module - #2160
Merged
Merged
Conversation
…and its one module imported
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 with-hide/hide-private#580
Closes with-hide/hide-private#606
Closes with-hide/hide-private#607
Closes with-hide/hide-private#608
Closes with-hide/hide-private#609
Closes with-hide/hide-private#385
Closes with-hide/hide-private#386
Closes with-hide/hide-private#387
Closes with-hide/hide-private#240
Closes with-hide/hide-private#241
Summary
Windows에서 기기 연결과 hook 시험의 첫 PowerShell 시작이 가끔 60-90 s 동안 아무 말 없이 멈췄습니다.
원인은 PowerShell이 처음 쓰는 명령(
Write-Output,New-Object,Add-Type,Test-Path)을 찾으려고 설치된 모듈 전체(러너에서 약 260개)를 읽는 데 있었습니다. 모듈 목록 캐시를 쓸 수 없으면 한 번에 12-38 s가 걸렸습니다.이제 기기 시작 스크립트는 자동 로드를 끄고 쓰는 모듈 하나만 이름으로 불러옵니다. 캐시 없이도 1 s 안쪽입니다. 제한 시간은 그대로입니다.
첫 시작이 기한을 넘기면 실패 메시지가 그 프로세스의 pid, 쓴 CPU 시간 대 경과 시간, 받은 캐시 경로를 말합니다.
Review
hide-node/src/ssh/bootstrap.rs- 실제 기기에 가는 래퍼입니다. 모든 로그인 셸의 따옴표 안에 들어가므로 따옴표 없는 형태로 썼고, 그 검사(the_powershell_wrapper_holds_nothing_a_login_shell_reads_inside_quotes)는 그대로 통과합니다. 자동 로드가 꺼져 있어 스크립트가 앞으로 Utility 밖의 cmdlet을 쓰면 그 자리에서 이름과 함께 실패합니다.hide-platform/src/process.rs- 새 사실cpu_time(pid)하나(macOSproc_pidinfo+ 시간 기준, Linux/proc/<pid>/stat, WindowsGetProcessTimes), 세 시스템 계약 시험processor_time_counts_a_process_s_work_and_not_its_wait.exec를 찾습니다. 캐시가 차가우면 그 한 번은 여전히 전체 모듈을 읽습니다(측정 38 s). POSIX 첫 문장 앞에는 아무것도 둘 수 없어 이 PR에서 다루지 않았습니다.Evidence
Write-Output17.4 s, 다시 12.1 s, 넷 동시 32 s; 자동 로드 끄고 Utility import 후Write-Output/New-Object/Add-Type0.87 s.it의 Windows 레인 선택(hook_deadline|windows_hook_command|windows_scripts) 20/20 통과.the_start_script_runs_under_an_empty_module_cache_without_building_one(빈 캐시에서 실제 스크립트가 캐시를 만들지 않음, import 줄)과a_cmdlet_outside_the_wrappers_import_fails_by_name_and_starts_no_search(import 밖 cmdlet은 이름과 함께 바로 실패, 자동 로드 줄). PR의 run 42212770068에서 1.0 s, 3.6 s로 통과. 자동 로드 줄만 지운 임시 브랜치 run 42212808334에서는 두 번째 시험이 실패(Get-Item을 21 s 검색 끝에 찾음).cpu_time계약 시험 macOS 로컬과 Windows 러너(run 42203347592)에서 통과. clippy, fmt 로컬 통과.C:\PSModuleAnalysisCachePath)가 왜 쓸 수 없었는지. 이제 캐시와 상관없이 기다리지 않으므로 고치는 데는 필요 없지만, 다시 멈추면 새 기한 보고가 이를 말합니다.codex_daemon::tests::a_windows_codex_that_runs_node_answers_its_features가 새 러너 20대 중 8대에서 실패(Node 첫 시작이 5 s 제품 기한을 넘김, PowerShell 아님, 이 PR과 무관): with-hide/hide-private#638.cpu_time계약은 이 PR의 os contract 레인이 확인합니다.powershell.exe와 네 로그인 셸로 돌리는 bootstrap windows_tests로 확인했습니다.Verification record