Repository navigation
Memory: 옮긴 state 폴더로 띄운 daemon의 pane hook이 그 daemon의 store를 읽습니다 - #949
Merged
Merged
Conversation
hook은 환경에서 경로를 받지 않으므로 기본 state 폴더만 읽었고, HIDE_STATE_DIR이나 XDG_STATE_HOME으로 옮긴 daemon의 pane은 Memory를 받지 못했습니다. 옮긴 daemon은 core를 만들 때 기본 state 폴더의 daemons/ 아래에 자기 Herdr 소켓 이름의 기록(state 폴더, pid, 시작 시각)을 남기고 core가 끝나면 지웁니다. hook은 pane에 Herdr가 넣는 HERDR_SOCKET_PATH를 기록을 찾는 이름으로만 쓰고, 계정 소유의 비공개 일반 파일이며 같은 소켓을 가리키는 기록이 비공개 폴더를 가리킬 때만 따릅니다. 검사가 하나라도 어긋나면 지금처럼 기본 store를 읽습니다.
handler를 깔기 전에 보낸 SIGTERM은 daemon을 기본 동작으로 죽여 테스트가 흔들렸습니다. HIDE_IDLE_SECS로 daemon이 스스로 끝나게 해 신호 경쟁 없이 정상 종료 경로를 확인합니다.
yansfil
added a commit
that referenced
this pull request
Oct 11, 2026
Related: #949 ## Summary #949(217c2ef)가 머지된 뒤 main의 desktop e2e가 매번 실패해서 그 머지를 되돌립니다. `desktop/e2e/home-layout.spec.ts:36`에서 새 앱의 첫 connect가 legacy state 폴더를 옮긴 뒤 10초가 지나도 옛 daemon이 살아 있습니다. #949 직전 main(c19a676)은 통과했고, 이후 main push 두 번(217c2ef, b277220)과 PR #955에서 같은 테스트가 재시도까지 실패했습니다. #949의 Memory locator는 원인을 고친 뒤 최신 main에서 새 PR로 다시 올립니다. ## Review - **판단해 주세요**: 되돌리는 동안 state 폴더를 옮긴 daemon(격리 QA 등)의 pane hook은 기본 store를 읽습니다. 기본 위치의 daemon은 영향이 없습니다. - **조심해서 볼 파일**: `herdr-core/src/handle.rs` - Core 필드와 시작 경로에서 등록 코드만 빠집니다. 뒤에 들어온 #953과 겹치는 참조는 없습니다(`rg`로 확인). ## Evidence - **확인한 것**: `git revert -m 1 217c2ef`가 충돌 없이 적용됐습니다. `scripts/verify-cargo.sh check`, `fmt-check`, `check-no-attribution.py`가 로컬에서 통과했습니다. 실패 로그는 run 38070779563, 38058398531, 38114057746의 desktop e2e입니다. - **확인하지 못한 것**: 원인은 아직 확인하지 않았습니다. 가설은 옮긴 폴더의 daemon이 시작할 때 기본 폴더(`~/.hide/state`)에 locator 기록을 써서, 마이그레이션이 옛 daemon 종료를 건너뛴다는 것입니다. desktop e2e 통과는 이 PR의 CI로 확인합니다.
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 #942
Summary
HIDE_STATE_DIR이나XDG_STATE_HOME으로 state 폴더를 옮겨 띄운 daemon은 Memory store를 그 폴더에 쓰는데, agent hook은~/.hide/state만 읽어서 그 daemon의 pane은 Memory를 받지 못했습니다.옮긴 daemon이 core를 만들 때 기본 state 폴더의
daemons/에 자기 Herdr 소켓 이름의 기록(state 폴더, pid, 시작 시각)을 남기고, core가 끝나면 지웁니다.hook은 pane에 Herdr가 넣는
HERDR_SOCKET_PATH를 기록을 찾는 이름으로만 쓰고, 기록이 가리키는 폴더의 store를 읽습니다. 기록이 없거나 검사가 하나라도 어긋나면 지금처럼 기본 store를 읽습니다.Review
hide-memory/src/locator.rs- hook의 지연 예산(100 ms) 안에서 파일 읽기만 하고 서브프로세스가 없는 경로이며, 모든 검사는 실패하면 기본 store로 갑니다.herdr-core/src/handle.rs- 등록은 core 생성 때 runtime lock 밖에서 한 번 하고,Core의 필드가 drop 때 지웁니다(kill로 죽으면 남고, 다음 등록이 지움).Evidence
HERDR_SOCKET_PATH없이 띄웠을 때도(소켓은 설정 폴더에서 유도) 켜고 띄웠을 때도 모든 pane에HERDR_SOCKET_PATH가 들어 있고, pane이 보는 값이 서버가 쓰는 소켓입니다.HIDE_STATE_DIR환경은 무시한다는 테스트, core가 쓰는 store와 hook이 읽는 store가 같다는 core 테스트.hided자식 프로세스로 옮긴 state 폴더에서 띄워 기록이 생기고 hook 경로가 그 폴더의 store가 됨, idle 종료 뒤 기록이 사라짐,SIGKILL로 죽은 daemon의 기록이 다음 daemon에서 교체됨(6회 연속 통과). 등록 호출을 빼면 두 테스트가 실패합니다.verify-cargo.sh lint,verify-cargo.sh test전체 통과, 시험 뒤 운영자의~/.hide/state/daemons는 생기지 않았습니다.