Skip to content

⚡ Bolt: [성능 개선] FileSystemArtifactStore에서 불필요한 Files.exists() 호출 제거 - #200

Closed
seonghobae wants to merge 1 commit into
mainfrom
bolt/optimize-files-exists-check-2113361946879920744
Closed

⚡ Bolt: [성능 개선] FileSystemArtifactStore에서 불필요한 Files.exists() 호출 제거#200
seonghobae wants to merge 1 commit into
mainfrom
bolt/optimize-files-exists-check-2113361946879920744

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Superseded by #222.

* `Files.exists()` 호출과 `Files.readAllBytes()` 간에 발생할 수 있는 TOCTOU (Time-Of-Check to Time-Of-Use) 경쟁 상태를 방지하기 위해 파일의 존재 여부 확인을 생략합니다.
* 파일 읽기를 바로 시도하고 `NoSuchFileException` 예외를 처리하여 파일 시스템의 stat 시스템 콜을 1회 줄여 성능을 향상시켰습니다.
@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 review requested due to automatic review settings July 24, 2026 21:12

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

Optimizes artifact PDF loading in the Clearfolio Viewer by removing a pre-read filesystem existence check and relying on NIO’s missing-file exception handling, reducing redundant syscalls and eliminating a TOCTOU window on the read path.

Changes:

  • Removed Files.exists() check before reading PDFs from disk.
  • Added explicit handling of NoSuchFileException to return Optional.empty() when the artifact is missing.
  • Documented the optimization and rationale in .jules/bolt.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/main/java/com/clearfolio/viewer/artifact/FileSystemArtifactStore.java Removes redundant existence check and handles missing-file via NoSuchFileException during reads.
.jules/bolt.md Adds a Bolt entry documenting the TOCTOU + syscall-overhead rationale and the preferred pattern.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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