Skip to content

Fix potential file handle leaks by clearing IntelliJ VFS cache#2790

Merged
hfmehmed merged 3 commits into
mainfrom
cleanup-file-handlers
Feb 17, 2026
Merged

Fix potential file handle leaks by clearing IntelliJ VFS cache#2790
hfmehmed merged 3 commits into
mainfrom
cleanup-file-handlers

Conversation

@hfmehmed

@hfmehmed hfmehmed commented Feb 13, 2026

Copy link
Copy Markdown
Collaborator

Improves resource management in the KSP Analysis API implementation by ensuring IntelliJ file handlers are properly cleaned up. When using the Kotlin Analysis API, the underlying CoreJarFileSystem maintains a cache of file handlers. If not explicitly cleared, this leads to issues in Windows where the OS holds the lock on a specific file making it impossible to re-run the build unless the existing gradle daemon is terminated. Linux and Mac os are more lenient in terms of file locking so this does not seem to be an issue there

Fixes: #2774

@hfmehmed hfmehmed changed the title Clean up file handlers (intellij) Fix potential file handle leaks by clearing IntelliJ VFS cache Feb 16, 2026
@hfmehmed hfmehmed merged commit 20ccb51 into main Feb 17, 2026
3 checks passed
@hfmehmed hfmehmed deleted the cleanup-file-handlers branch February 18, 2026 10:42

@Hamoo456 Hamoo456 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.

good

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.

Module recompilation fails on Windows when KSP2 is enabled

3 participants