Skip to content

⚡ Bolt: FileSystemArtifactStore에서 불필요한 Files.exists() 호출 제거 - #191

Closed
seonghobae wants to merge 1 commit into
mainfrom
bolt-optimize-filesystem-read-15358147149877394483
Closed

⚡ Bolt: FileSystemArtifactStore에서 불필요한 Files.exists() 호출 제거#191
seonghobae wants to merge 1 commit into
mainfrom
bolt-optimize-filesystem-read-15358147149877394483

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Superseded by #222.

파일 읽기 전 `Files.exists(pdfPath)` 호출을 제거하여 디스크 I/O를 반으로 줄이고, TOCTOU 경쟁 상태를 방지했습니다.
대신 `bytesReader.read(pdfPath)`에서 직접 `java.nio.file.NoSuchFileException`을 잡아 처리하도록 최적화했습니다.
Copilot AI review requested due to automatic review settings July 22, 2026 20:54
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 95 to +97
return Optional.of(loaded.clone());
} catch (java.nio.file.NoSuchFileException ex) {
return Optional.empty();
@seonghobae seonghobae closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants