Skip to content

Commit

Permalink
[hotfix][runtime] Invalidate cache correctly to avoid classloader lea…
Browse files Browse the repository at this point in the history
…kage
  • Loading branch information
yuxiqian committed Aug 13, 2024
1 parent 1042095 commit 9c0b8d1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public class TransformExpressionCompiler {

/** Triggers internal garbage collection of expired cache entries. */
public static void cleanUp() {
COMPILED_EXPRESSION_CACHE.cleanUp();
// com.google.common.cache.Cache from Guava isn't guaranteed to clear all cached records
// when invoking Cache#cleanUp, which may cause classloader leakage. Use #invalidateAll
// instead to ensure all key / value pairs to be correctly discarded.
COMPILED_EXPRESSION_CACHE.invalidateAll();
}

/** Compiles an expression code to a janino {@link ExpressionEvaluator}. */
Expand Down

0 comments on commit 9c0b8d1

Please sign in to comment.