This is an automated email from the ASF dual-hosted git repository.

leonard pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-cdc.git


The following commit(s) were added to refs/heads/master by this push:
     new 874ff4ff2 [hotfix][cdc-runtime] Invalidate cache correctly to avoid 
classloader leakage
874ff4ff2 is described below

commit 874ff4ff2088d99db43a5d689aa61e7be960e31e
Author: yuxiqian <[email protected]>
AuthorDate: Tue Aug 13 16:58:05 2024 +0800

    [hotfix][cdc-runtime] Invalidate cache correctly to avoid classloader 
leakage
    
    This closes #3533
---
 .../cdc/runtime/operators/transform/TransformExpressionCompiler.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/TransformExpressionCompiler.java
 
b/flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/TransformExpressionCompiler.java
index e22d7943d..326ae7ba7 100644
--- 
a/flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/TransformExpressionCompiler.java
+++ 
b/flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/TransformExpressionCompiler.java
@@ -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}. */

Reply via email to