Skip to content

Test that crashes Guice inside Guava - #1389

Closed
swankjesse wants to merge 1 commit into
google:masterfrom
swankjesse:jwilson.0831.recursive_load
Closed

swankjesse wants to merge 1 commit into
google:masterfrom
swankjesse:jwilson.0831.recursive_load

Conversation

@swankjesse

Copy link
Copy Markdown

This test causes Guice to violate the requirements of Guava's
LoadingCache by triggering a recursive load.

The recursive load crashes either with an UncheckedExecutionException
(bad) or causes a deadlock (terrible).

#785

@google-cla google-cla Bot added the cla: yes label Sep 1, 2020
@swankjesse
swankjesse force-pushed the jwilson.0831.recursive_load branch from b0fe032 to 46e4d12 Compare September 1, 2020 04:31
This test causes Guice to violate the requirements of Guava's
LoadingCache by triggering a recursive load.

The recursive load crashes either with an UncheckedExecutionException
(bad) or causes a deadlock (terrible).

google#785
@swankjesse
swankjesse force-pushed the jwilson.0831.recursive_load branch from 46e4d12 to cf780f9 Compare September 1, 2020 12:42
@swankjesse

Copy link
Copy Markdown
Author

PR that includes this commit plus another commit with a fix:
#1394

copybara-service Bot pushed a commit that referenced this pull request Apr 18, 2023
…nd/or crash inside Guava's LoadingCache. The problem had to do with the fact that Guice eagerly stores uninitialized JIT bindings in an attempt to allow circular dependencies, and Guice also attempts to cleanup failed JIT bindings (to remove these uninitialized JIT bindings). The JIT binding cache was a guard against a recursive call back into the constructor's cache, but we were removing that guard.

We now only remove the guard if we aren't in the process of loading that JIT binding. The failed JIT binding is naturally cleaned up later on, as the existing & new tests attest to.

Fixes many issues:
 - Fixes #1633
 - Fixes #785
 - Fixes #1389
 - Fixes #1394

Many thanks to @swankjesse for the test-case added in #1389 that was helpful in diagnosing the problem, and to @PaulFridrick for the diagnoses in #1633.

PiperOrigin-RevId: 525135213
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址