You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "zoltar9264 (via GitHub)" <gi...@apache.org> on 2023/03/13 08:18:24 UTC

[GitHub] [flink] zoltar9264 opened a new pull request, #22168: [FLINK-31414][checkpointing] exceptions in the alignment timer are ig…

zoltar9264 opened a new pull request, #22168:
URL: https://github.com/apache/flink/pull/22168

   …nored
   
   
   ## What is the purpose of the change
   
   fix problem described in [FLINK-31414](https://issues.apache.org/jira/browse/FLINK-31414).
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes, checkpointing)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
   


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] flinkbot commented on pull request #22168: [FLINK-31414][checkpointing] exceptions in the alignment timer are ig…

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #22168:
URL: https://github.com/apache/flink/pull/22168#issuecomment-1465698096

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "0ac9e1ec9644bc7e3cd435e2a0ee4d6d86eb5aa6",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0ac9e1ec9644bc7e3cd435e2a0ee4d6d86eb5aa6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0ac9e1ec9644bc7e3cd435e2a0ee4d6d86eb5aa6 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] zoltar9264 commented on pull request #22168: [FLINK-31414][checkpointing] exceptions in the alignment timer are ig…

Posted by "zoltar9264 (via GitHub)" <gi...@apache.org>.
zoltar9264 commented on PR #22168:
URL: https://github.com/apache/flink/pull/22168#issuecomment-1469191958

   Thanks for your @pnowojski , I change the test as you commented and squash the commits.


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] zoltar9264 commented on pull request #22168: [FLINK-31414][checkpointing] exceptions in the alignment timer are ig…

Posted by "zoltar9264 (via GitHub)" <gi...@apache.org>.
zoltar9264 commented on PR #22168:
URL: https://github.com/apache/flink/pull/22168#issuecomment-1467682942

   Thanks @pnowojski , I will add unit later.


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] pnowojski commented on pull request #22168: [FLINK-31414][checkpointing] exceptions in the alignment timer are ig…

Posted by "pnowojski (via GitHub)" <gi...@apache.org>.
pnowojski commented on PR #22168:
URL: https://github.com/apache/flink/pull/22168#issuecomment-1467662825

   It would be great to have a simple unit test of `org.apache.flink.streaming.runtime.io.checkpointing.BarrierAlignmentUtil#createRegisterTimerCallback` that shows that an exception is not hidden.
   


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] pnowojski commented on a diff in pull request #22168: [FLINK-31414][checkpointing] exceptions in the alignment timer are ig…

Posted by "pnowojski (via GitHub)" <gi...@apache.org>.
pnowojski commented on code in PR #22168:
URL: https://github.com/apache/flink/pull/22168#discussion_r1135584436


##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/checkpointing/BarrierAlignmentUtilTest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.runtime.io.checkpointing;
+
+import org.apache.flink.api.common.operators.MailboxExecutor;
+import org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor;
+import org.apache.flink.streaming.runtime.tasks.TestProcessingTimeService;
+import org.apache.flink.streaming.runtime.tasks.mailbox.MailboxExecutorImpl;
+import org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor;
+import org.apache.flink.streaming.runtime.tasks.mailbox.TaskMailbox;
+import org.apache.flink.streaming.runtime.tasks.mailbox.TaskMailboxImpl;
+
+import org.junit.Test;
+
+import java.io.IOException;
+import java.time.Duration;
+
+import static org.junit.Assert.assertThrows;
+
+public class BarrierAlignmentUtilTest {
+
+    @Test
+    public void testDelayableTimerNotHiddenException() throws Exception {
+        TaskMailbox mailbox = new TaskMailboxImpl();
+        MailboxProcessor mailboxProcessor =
+                new MailboxProcessor(controller -> {}, mailbox, StreamTaskActionExecutor.IMMEDIATE);
+        MailboxExecutor mailboxExecutor =
+                new MailboxExecutorImpl(
+                        mailbox, 0, StreamTaskActionExecutor.IMMEDIATE, mailboxProcessor);
+
+        TestProcessingTimeService timerService = new TestProcessingTimeService();
+        timerService.setCurrentTime(System.currentTimeMillis());
+
+        BarrierAlignmentUtil.DelayableTimer delayableTimer =
+                BarrierAlignmentUtil.createRegisterTimerCallback(mailboxExecutor, timerService);
+
+        Duration delay = Duration.ofMinutes(10);
+
+        delayableTimer.registerTask(
+                () -> {
+                    // simulate IOException in checkpoint sync phase
+                    throw new IOException();
+                },
+                delay);
+
+        timerService.advance(delay.toMillis());
+
+        assertThrows(
+                "BarrierAlignmentUtil.DelayableTimer should not hidden exception",
+                IOException.class,
+                () -> mailboxProcessor.runMailboxStep());

Review Comment:
   nit: If you use `org.apache.flink.util.ExceptionUtils#assertThrowable(...)` or `ExceptionUtils#findThrowable` the test would be more resilient (for example if the original exception will be wrapped on some layer.



##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/checkpointing/BarrierAlignmentUtilTest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.runtime.io.checkpointing;
+
+import org.apache.flink.api.common.operators.MailboxExecutor;
+import org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor;
+import org.apache.flink.streaming.runtime.tasks.TestProcessingTimeService;
+import org.apache.flink.streaming.runtime.tasks.mailbox.MailboxExecutorImpl;
+import org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor;
+import org.apache.flink.streaming.runtime.tasks.mailbox.TaskMailbox;
+import org.apache.flink.streaming.runtime.tasks.mailbox.TaskMailboxImpl;
+
+import org.junit.Test;
+
+import java.io.IOException;
+import java.time.Duration;
+
+import static org.junit.Assert.assertThrows;
+
+public class BarrierAlignmentUtilTest {
+
+    @Test
+    public void testDelayableTimerNotHiddenException() throws Exception {
+        TaskMailbox mailbox = new TaskMailboxImpl();
+        MailboxProcessor mailboxProcessor =
+                new MailboxProcessor(controller -> {}, mailbox, StreamTaskActionExecutor.IMMEDIATE);
+        MailboxExecutor mailboxExecutor =
+                new MailboxExecutorImpl(
+                        mailbox, 0, StreamTaskActionExecutor.IMMEDIATE, mailboxProcessor);
+
+        TestProcessingTimeService timerService = new TestProcessingTimeService();
+        timerService.setCurrentTime(System.currentTimeMillis());
+
+        BarrierAlignmentUtil.DelayableTimer delayableTimer =
+                BarrierAlignmentUtil.createRegisterTimerCallback(mailboxExecutor, timerService);
+
+        Duration delay = Duration.ofMinutes(10);
+
+        delayableTimer.registerTask(
+                () -> {
+                    // simulate IOException in checkpoint sync phase
+                    throw new IOException();

Review Comment:
   nit: I would throw a custom exception, like for example `org.apache.flink.runtime.operators.testutils.ExpectedTestException`. It's less likely to collide with some actual failure reported via `IOException`.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] zoltar9264 commented on pull request #22168: [FLINK-31414][checkpointing] exceptions in the alignment timer are ig…

Posted by "zoltar9264 (via GitHub)" <gi...@apache.org>.
zoltar9264 commented on PR #22168:
URL: https://github.com/apache/flink/pull/22168#issuecomment-1467902141

   Hi @pnowojski , I added a unit test for `BarrierAlignmentUtil#createRegisterTimerCallback`, please take a look.


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] pnowojski merged pull request #22168: [FLINK-31414][checkpointing] exceptions in the alignment timer are ig…

Posted by "pnowojski (via GitHub)" <gi...@apache.org>.
pnowojski merged PR #22168:
URL: https://github.com/apache/flink/pull/22168


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org