You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Instantiating Cache in a custom system class loader leads to a recursive invocation exceptionΒ #6565
Having a custom system class loader, which instantiates com.google.common.cache.Cache as part of its construction results in recursive invocation exception.
The error occurs in line 240 of com.google.common.cache.CacheBuilder. The code comment suggests that this situation was envisaged. This was working correctly in version 31.1-jre and the error started to manifest in version 32.0.0-jre.
I can back out that change. In the abstract, I would say that "using Guava from a system class loader" is a use case that we wouldn't necessarily go to much effort to support, so no guarantees on future support for this in general. But please do let us know of other such problems, and if they're as easy to fix as this one, we can probably take care of them, too. (As you saw, we have at least one such class loader internally, so that code might continue to catch some problems that might otherwise affect you.)
If you're in a position to build your own copy of Guava with the fix and verify that this is the only problem lambda, that could help: The Guava release that fixes this will be the third release in about a month, so I'd love if we could avoid having to release a fourth with an additional fix :)
The fix landed in 32.1.0, but because we got the Gradle metadata wrong in that release, I suggest going straight to 32.1.1, which also contains the fix for that problem.
Activity
cpovirk commentedon Jun 20, 2023
Thanks.
I can back out that change. In the abstract, I would say that "using Guava from a system class loader" is a use case that we wouldn't necessarily go to much effort to support, so no guarantees on future support for this in general. But please do let us know of other such problems, and if they're as easy to fix as this one, we can probably take care of them, too. (As you saw, we have at least one such class loader internally, so that code might continue to catch some problems that might otherwise affect you.)
cpovirk commentedon Jun 20, 2023
If you're in a position to build your own copy of Guava with the fix and verify that this is the only problem lambda, that could help: The Guava release that fixes this will be the third release in about a month, so I'd love if we could avoid having to release a fourth with an additional fix :)
01es commentedon Jun 21, 2023
@cpovirk, thank you for your comment re "using Guava from a system class loader" β something to keep in mind moving forward.
I have checkout the source under tag

v32.0.1, made the change (patch) as depicted below, and voila β everything works at our end. Thank you.Partial rollback of cl/441881361 to fix #6565
Delay initializing the `CacheBuilder` logger until it is needed.
Delay initializing the `CacheBuilder` logger until it is needed.
cpovirk commentedon Jun 30, 2023
The fix landed in 32.1.0, but because we got the Gradle metadata wrong in that release, I suggest going straight to 32.1.1, which also contains the fix for that problem.
Partial rollback of cl/441881361 to fix google#6565