8000 Fallback to root paths in LibraryRootsSearchScope by bcorso · Pull Request #3293 · google/ksp · GitHub
[go: up one dir, main page]

Skip to content

Fallback to root paths in LibraryRootsSearchScope - #3293

Open
bcorso wants to merge 1 commit into
google:mainfrom
bcorso:bcorso/fix-issue-3286
Open

bcorso wants to merge 1 commit into
google:mainfrom
bcorso:bcorso/fix-issue-3286

Conversation

@bcorso
@bcorso bcorso commented Nov 5, 2026
Copy link
Copy Markdown
Collaborator

CoreJarVirtualFile does not override equals or hashCode and relies on object identity within a single CoreJarHandler instance. If CoreJarFileSystem.clearHandlersCache() is called while a LibraryRootsSearchScope is still in use (e.g. during concurrent in-process KSP executions), subsequent JAR lookups recreate CoreJarHandler and CoreJarVirtualFile instances, causing rootFiles.contains(current) to return false.

Keep rootFiles for fast reference-identity checks and fall back to checking rootUrls when traversal reaches the top-level root (current.parent == null).

Fixes #3286

…e cleared

CoreJarVirtualFile does not override equals or hashCode and relies on
object identity within a single CoreJarHandler instance. If
CoreJarFileSystem.clearHandlersCache() is called while a
LibraryRootsSearchScope is still in use (e.g. during concurrent
in-process KSP executions), subsequent JAR lookups recreate
CoreJarHandler and CoreJarVirtualFile instances, causing
rootFiles.contains(current) to return false.

Keep rootFiles for fast reference-identity checks and fall back to
checking rootUrls when traversal reaches the top-level root
(current.parent == null).

Fixes google#3286
@jaschdoc jaschdoc left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Left a review in #3294 since I saw that PR first. Some of the comments also apply to this PR. Apologies for the confusion. Thanks for the PRs :)

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.

KSP 2.3.13 regression: library symbols disappear during concurrent in-process executions

2 participants

0