RocMarshal commented on code in PR #27186:
URL: https://github.com/apache/flink/pull/27186#discussion_r2532910037


##########
flink-runtime/src/test/java/org/apache/flink/runtime/util/SerializedThrowableTest.java:
##########
@@ -179,4 +187,60 @@ void testCopySuppressed() {
                 .isInstanceOf(SerializedThrowable.class)
                 .hasMessage("java.lang.Exception: suppressed");
     }
+
+    @Test
+    void testCyclicSuppressedThrowableSerialized() {
+        SerializedThrowable serializedThrowable = new 
SerializedThrowable(mockThrowable());
+        assertThat(serializedThrowable).isNotNull();
+    }
+
+    @Test
+    void testCyclicSuppressedThrowableConcurrentSerialized() throws 
InterruptedException {

Review Comment:
   <img width="3236" height="1836" alt="image" 
src="https://github.com/user-attachments/assets/b24d45f2-62e6-4676-bbaa-e86f192aeb66";
 />
   
     
   ----
   
   <img width="3262" height="1436" alt="image" 
src="https://github.com/user-attachments/assets/b1b60262-0049-4ac3-af02-cbea3ff6b506";
 />
   
   ----
   Hi, @Myasuka Thanks for your reminding.
   
   I increased the number of test runs for the current test case using 
RepeatedTest and found that deadlocks can indeed still occur.    
   
   We considered a solution: making all methods of SerializedThrowable private, 
thereby controlling the creation of SerializedThrowable objects through a 
single unified entry point. The goal was to try to elevate the locking 
hierarchy to the serialized exception object itself.
   
   <img width="1286" height="630" alt="image" 
src="https://github.com/user-attachments/assets/fea03ea0-7d7f-49db-9e92-b0bb69268286";
 />
   
   
   Unfortunately, the following situation can still occur:
   
   When one thread calls the unified creation method, another thread may 
already be holding the object lock of another exception object referenced 
within the exception. In such a case, a deadlock can still potentially happen.
   
   Looking forward to your thoughts on this~
   Any input is aprreciated !



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to