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

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new 420fc7dea [hotfix] Fix throw error for OOM retry in CodeGenUtils
420fc7dea is described below

commit 420fc7dea6e223ab7fd2c333dc5007436639855a
Author: Jingsong <jingsongl...@gmail.com>
AuthorDate: Fri Nov 8 16:03:01 2024 +0800

    [hotfix] Fix throw error for OOM retry in CodeGenUtils
---
 .../main/java/org/apache/paimon/codegen/CodeGenUtils.java  | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/paimon-core/src/main/java/org/apache/paimon/codegen/CodeGenUtils.java 
b/paimon-core/src/main/java/org/apache/paimon/codegen/CodeGenUtils.java
index e82ec144d..18f8e628f 100644
--- a/paimon-core/src/main/java/org/apache/paimon/codegen/CodeGenUtils.java
+++ b/paimon-core/src/main/java/org/apache/paimon/codegen/CodeGenUtils.java
@@ -120,7 +120,7 @@ public class CodeGenUtils {
     private static <T> Pair<Class<?>, Object[]> generateClass(
             Supplier<GeneratedClass<T>> supplier) {
         long time = System.currentTimeMillis();
-        RuntimeException ex;
+        OutOfMemoryError toThrow;
 
         do {
             try {
@@ -134,13 +134,15 @@ public class CodeGenUtils {
                 try {
                     Thread.sleep(5_000);
                 } catch (InterruptedException e) {
-                    Thread.interrupted();
-                    throw new RuntimeException("Sleep interrupted", error);
+                    Thread.currentThread().interrupt();
+                    throw error;
                 }
-                ex = new RuntimeException("Meet meta space oom while 
generating class.", error);
+                toThrow = error;
             }
-        } while ((System.currentTimeMillis() - time) < 60_000);
-        throw ex;
+        } while ((System.currentTimeMillis() - time) < 120_000);
+
+        // retry fail
+        throw toThrow;
     }
 
     private static class ClassKey {

Reply via email to