⚡ Bolt: FileSystemArtifactStore에서 불필요한 Files.exists() 호출 제거 - #191
⚡ Bolt: FileSystemArtifactStore에서 불필요한 Files.exists() 호출 제거#191seonghobae wants to merge 1 commit into
Conversation
파일 읽기 전 `Files.exists(pdfPath)` 호출을 제거하여 디스크 I/O를 반으로 줄이고, TOCTOU 경쟁 상태를 방지했습니다. 대신 `bytesReader.read(pdfPath)`에서 직접 `java.nio.file.NoSuchFileException`을 잡아 처리하도록 최적화했습니다.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
FileSystemArtifactStore#getPdf에서 파일 읽기 전 Files.exists()로 사전 확인하던 로직을 제거하고, 실제 읽기 시점에 NoSuchFileException을 처리하도록 변경해 불필요한 I/O(stat)와 TOCTOU 가능성을 줄이는 최적화 PR입니다.
Changes:
getPdf에서Files.exists()체크 제거 후NoSuchFileException기반으로 “파일 없음”을Optional.empty()로 처리- 실패 케이스(기타
IOException)는 기존대로IllegalStateException으로 래핑 - 변경 사항을
CHANGELOG.md및.jules/bolt.md에 기록
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main/java/com/clearfolio/viewer/artifact/FileSystemArtifactStore.java | Files.exists() 제거 및 NoSuchFileException 처리로 I/O 최적화/TOCTOU 완화 |
| CHANGELOG.md | 위 최적화 내용을 Unreleased 변경 내역에 추가 |
| .jules/bolt.md | 최적화 학습/액션 항목을 지식 로그에 추가 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return Optional.of(loaded.clone()); | ||
| } catch (java.nio.file.NoSuchFileException ex) { | ||
| return Optional.empty(); |
Superseded by #222.