spuru9 commented on code in PR #28359:
URL: https://github.com/apache/flink/pull/28359#discussion_r3376618478


##########
flink-core/src/test/java/org/apache/flink/core/memory/OffHeapUnsafeMemorySegmentTest.java:
##########
@@ -80,8 +80,22 @@ void testCallCleanerOnceOnConcurrentFree() throws 
InterruptedException {
         final MemorySegment segment =
                 MemorySegmentFactory.allocateOffHeapUnsafeMemory(10, null, 
cleaner);
 
-        final Thread t1 = new Thread(segment::free);
-        final Thread t2 = new Thread(segment::free);
+        final Runnable free =
+                () -> {
+                    try {
+                        segment.free();
+                    } catch (IllegalStateException e) {
+                        // On concurrent free() the thread that loses the race 
observes the

Review Comment:
   nit: adding these comments to the flink code for each debug could make the 
code lengthy. Can you shorten it? Reference to jira and detail debug could be 
reduced.



-- 
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