Skip to content

Conversation

@tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Jun 5, 2025

In long running sessions of presentation compiler it seem like these caches can easily get corrupted and we longer can use the compiler within the current JVM or classloader.

I couldn't find the exact problem, but this is the only difference with Scala 2.12 and Scala 3, where those caches are not present. We don'tget those issues there.

I added a workaround in Metals for this, but it uses reflection quite heavily.

Alternatively, maybe this caching is not needed? I see that it's created only in Global once, so maybe we could cache it in Global instead?

The workaround with reflection is in https://github.com/scalameta/metals/pull/7541/files

Should help with scala/bug#13045

@scala-jenkins scala-jenkins added this to the 2.13.17 milestone Jun 5, 2025
@tgodzik
Copy link
Contributor Author

tgodzik commented Jun 5, 2025

That said, I don't know if those caches are causing the issue, but it's my best guess.

In long running sessions of presentation compiler it seem like these caches can easily get corrupted and we longer can use the compiler within the current JVM or classloader. I couldn't find the exact problem, but this is the only difference with Scala 2.12 and Scala 3, where those caches are not present. We don'tget those issues there. I added a workaround in Metals for this, but it uses reflection quite heavily. Alternatively, maybe this caching is not needed? I see that it's created only in Global once, so maybe we could cache it in Global instead?
@tgodzik tgodzik force-pushed the allow-clearing-caches branch from a5cbb30 to 9ef54d3 Compare June 5, 2025 14:16
@tgodzik
Copy link
Contributor Author

tgodzik commented Jun 5, 2025

I know realized, we can do the same with close() on global? 🤔

@tgodzik tgodzik closed this Jun 5, 2025
@SethTisue SethTisue removed this from the 2.13.17 milestone Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants