You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/04/08 17:17:29 UTC

[GitHub] [flink-kubernetes-operator] SteNicholas opened a new pull request, #161: [FLINK-27141] Improve FlinkService#waitForClusterShutdown logic

SteNicholas opened a new pull request, #161:
URL: https://github.com/apache/flink-kubernetes-operator/pull/161

   The current `waitForClusterShutdown` logic has a hardcoded 60 second timeout and prints a log message after every second, which should be improved to make the max timeout configurable and only log a message once every 5-10 seconds to make this more reasonable.
   
   **The brief change log**
   
   - `waitForClusterShutdown` adds the max timeout configuration `operator.reconciler.flink.shutdown.cluster.timeout` and logs a message once every 5 seconds.


-- 
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-kubernetes-operator] SteNicholas commented on a diff in pull request #161: [FLINK-27141] Improve FlinkService#waitForClusterShutdown logic

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on code in PR #161:
URL: https://github.com/apache/flink-kubernetes-operator/pull/161#discussion_r846865468


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/FlinkUtils.java:
##########
@@ -207,7 +213,10 @@ public static void waitForClusterShutdown(
             if (!jobManagerRunning && !serviceRunning) {
                 break;
             }
-            LOG.info("Waiting for cluster shutdown... ({})", i);
+            // log a message waiting to shutdown Flink cluster every 5 seconds.
+            if (i % 4 == 0) {

Review Comment:
   @gyfora , i start from 0, therefore print the log every 5 seconds.



-- 
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-kubernetes-operator] SteNicholas commented on a diff in pull request #161: [FLINK-27141] Improve FlinkService#waitForClusterShutdown logic

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on code in PR #161:
URL: https://github.com/apache/flink-kubernetes-operator/pull/161#discussion_r847007756


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/FlinkUtils.java:
##########
@@ -207,7 +213,10 @@ public static void waitForClusterShutdown(
             if (!jobManagerRunning && !serviceRunning) {
                 break;
             }
-            LOG.info("Waiting for cluster shutdown... ({})", i);
+            // log a message waiting to shutdown Flink cluster every 5 seconds.
+            if (i % 4 == 0) {

Review Comment:
   @gyfora, sorry for this mistake. I will update this as soon as possible.



-- 
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-kubernetes-operator] gyfora commented on a diff in pull request #161: [FLINK-27141] Improve FlinkService#waitForClusterShutdown logic

Posted by GitBox <gi...@apache.org>.
gyfora commented on code in PR #161:
URL: https://github.com/apache/flink-kubernetes-operator/pull/161#discussion_r846993644


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/FlinkUtils.java:
##########
@@ -207,7 +213,10 @@ public static void waitForClusterShutdown(
             if (!jobManagerRunning && !serviceRunning) {
                 break;
             }
-            LOG.info("Waiting for cluster shutdown... ({})", i);
+            // log a message waiting to shutdown Flink cluster every 5 seconds.
+            if (i % 4 == 0) {

Review Comment:
   I think that is actually incorrect, it will print:
   1, 5, 9, 13...



-- 
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-kubernetes-operator] gyfora commented on a diff in pull request #161: [FLINK-27141] Improve FlinkService#waitForClusterShutdown logic

Posted by GitBox <gi...@apache.org>.
gyfora commented on code in PR #161:
URL: https://github.com/apache/flink-kubernetes-operator/pull/161#discussion_r846827058


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/FlinkUtils.java:
##########
@@ -207,7 +213,10 @@ public static void waitForClusterShutdown(
             if (!jobManagerRunning && !serviceRunning) {
                 break;
             }
-            LOG.info("Waiting for cluster shutdown... ({})", i);
+            // log a message waiting to shutdown Flink cluster every 5 seconds.
+            if (i % 4 == 0) {

Review Comment:
   Wouldn't this actually print it every 4 seconds?



##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/OperatorConfigOptions.java:
##########
@@ -70,9 +70,17 @@
                     .withDescription(
                             "The timeout for the observer to wait the flink rest client to return.");
 
-    public static final ConfigOption<Duration> OPERATOR_CANCEL_JOB_TIMEOUT =
+    public static final ConfigOption<Duration> OPERATOR_RECONCILER_FLINK_CANCEL_JOB_TIMEOUT =
             ConfigOptions.key("operator.reconciler.flink.cancel.job.timeout")
                     .durationType()
                     .defaultValue(Duration.ofMinutes(1))
-                    .withDescription("The timeout for the operator to cancel job.");
+                    .withDescription(
+                            "The timeout for the reconciler to wait for flink to cancel job.");
+
+    public static final ConfigOption<Duration> OPERATOR_RECONCILER_FLINK_SHUTDOWN_CLUSTER_TIMEOUT =
+            ConfigOptions.key("operator.reconciler.flink.shutdown.cluster.timeout")

Review Comment:
   should be `operator.reconciler.flink.cluster.shutdown.timeout` instead



-- 
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-kubernetes-operator] SteNicholas commented on a diff in pull request #161: [FLINK-27141] Improve FlinkService#waitForClusterShutdown logic

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on code in PR #161:
URL: https://github.com/apache/flink-kubernetes-operator/pull/161#discussion_r846865468


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/FlinkUtils.java:
##########
@@ -207,7 +213,10 @@ public static void waitForClusterShutdown(
             if (!jobManagerRunning && !serviceRunning) {
                 break;
             }
-            LOG.info("Waiting for cluster shutdown... ({})", i);
+            // log a message waiting to shutdown Flink cluster every 5 seconds.
+            if (i % 4 == 0) {

Review Comment:
   @gyfora , `i` start from 0, therefore print the log every 5 seconds.



-- 
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-kubernetes-operator] gyfora merged pull request #161: [FLINK-27141] Improve FlinkService#waitForClusterShutdown logic

Posted by GitBox <gi...@apache.org>.
gyfora merged PR #161:
URL: https://github.com/apache/flink-kubernetes-operator/pull/161


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