Skip to content

Commit 874ff4f

Browse files
authored
[hotfix][cdc-runtime] Invalidate cache correctly to avoid classloader leakage
This closes #3533
1 parent ed83229 commit 874ff4f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/TransformExpressionCompiler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ public class TransformExpressionCompiler {
3939

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

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

0 commit comments

Comments
 (0)