lsyldliu commented on code in PR #26646:
URL: https://github.com/apache/flink/pull/26646#discussion_r2131693305


##########
flink-core/src/test/java/org/apache/flink/core/fs/AbstractRecoverableWriterTest.java:
##########
@@ -42,6 +44,8 @@
  */
 public abstract class AbstractRecoverableWriterTest {
 
+    private static final Logger Log = 
LoggerFactory.getLogger(AbstractRecoverableWriterTest.class);

Review Comment:
   ```suggestion
       private static final Logger LOG = 
LoggerFactory.getLogger(AbstractRecoverableWriterTest.class);
   ```



##########
flink-core/src/test/java/org/apache/flink/core/fs/AbstractRecoverableWriterTest.java:
##########
@@ -236,9 +253,13 @@ private void testResumeAfterMultiplePersist(
                 
assertThat(fileContents.getKey().getName()).startsWith(".part-0.inprogress.");
                 
assertThat(fileContents.getValue()).isEqualTo(expectedPostRecoveryContents);
             }
-
-            recoveredStream.write(testData3.getBytes(StandardCharsets.UTF_8));
-            recoveredStream.closeForCommit().commit();
+            try {
+                
recoveredStream.write(testData3.getBytes(StandardCharsets.UTF_8));
+                recoveredStream.closeForCommit().commit();
+            } catch (IOException e) {
+                Log.warn("Final write failed: {}", e.getMessage());

Review Comment:
   ```suggestion
                   LOG.warn("Final write failed: {}", e.getMessage());
   ```



##########
flink-core/src/test/java/org/apache/flink/core/fs/AbstractRecoverableWriterTest.java:
##########
@@ -196,16 +200,29 @@ private void testResumeAfterMultiplePersist(
         final Map<String, RecoverableWriter.ResumeRecoverable> recoverables = 
new HashMap<>(4);
         RecoverableFsDataOutputStream stream = null;
         try {
-            stream = initWriter.open(path);
-            recoverables.put(INIT_EMPTY_PERSIST, stream.persist());
-
-            stream.write(testData1.getBytes(StandardCharsets.UTF_8));
-
-            recoverables.put(INTERM_WITH_STATE_PERSIST, stream.persist());
-            recoverables.put(INTERM_WITH_NO_ADDITIONAL_STATE_PERSIST, 
stream.persist());
-
-            // and write some more data
-            stream.write(testData2.getBytes(StandardCharsets.UTF_8));
+            // This is just for locate  the root cause:
+            // https://issues.apache.org/jira/browse/FLINK-37703
+            // After the fix, this logic should be reverted.
+            int times = 0;
+            try {
+                times++;
+                stream = initWriter.open(path);
+                recoverables.put(INIT_EMPTY_PERSIST, stream.persist());
+
+                times++;
+                stream.write(testData1.getBytes(StandardCharsets.UTF_8));
+
+                recoverables.put(INTERM_WITH_STATE_PERSIST, stream.persist());
+                recoverables.put(INTERM_WITH_NO_ADDITIONAL_STATE_PERSIST, 
stream.persist());
+
+                // and write some more data
+                times++;
+                stream.write(testData2.getBytes(StandardCharsets.UTF_8));
+
+            } catch (IOException e) {
+                Log.warn("{} execution failed, err message{}: ", times, 
e.getMessage());

Review Comment:
   ```suggestion
                   LOG.warn("{} execution failed, err message{}: ", times, 
e.getMessage());
   ```



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