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/05/19 18:00:40 UTC

[GitHub] [flink-kubernetes-operator] gyfora opened a new pull request, #228: [FLINK-27686] Only patch status on change

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

   Check whether status changed before applying patch to reduce load on the kubernetes API.


-- 
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 #228: [FLINK-27686] Only patch status on change

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


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/StatusHelper.java:
##########
@@ -64,6 +67,14 @@ public <T extends CustomResource<?, STATUS>> void patchAndCacheStatus(T resource
         // in the meantime
         resource.getMetadata().setResourceVersion(null);
 
+        ObjectNode newStatus = objectMapper.convertValue(resource.getStatus(), ObjectNode.class);
+        ObjectNode previousStatus = statusCache.put(getKey(resource), newStatus);
+
+        if (previousStatus == null || newStatus.equals(previousStatus)) {

Review Comment:
   Very good catch you are right @Aitozi 



-- 
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 #228: [FLINK-27686] Only patch status on change

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


-- 
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] Aitozi commented on a diff in pull request #228: [FLINK-27686] Only patch status on change

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


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/StatusHelper.java:
##########
@@ -64,6 +67,14 @@ public <T extends CustomResource<?, STATUS>> void patchAndCacheStatus(T resource
         // in the meantime
         resource.getMetadata().setResourceVersion(null);
 
+        ObjectNode newStatus = objectMapper.convertValue(resource.getStatus(), ObjectNode.class);
+        ObjectNode previousStatus = statusCache.put(getKey(resource), newStatus);
+
+        if (previousStatus == null || newStatus.equals(previousStatus)) {

Review Comment:
   why here do not need to patch status when the previousStatus is null ?



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