You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/06/15 16:23:39 UTC

[GitHub] [airflow] dstandish opened a new pull request, #24478: Return empty dict if Pod JSON encoding fails

dstandish opened a new pull request, #24478:
URL: https://github.com/apache/airflow/pull/24478

   When UI unpickles executor_configs with outdated k8s objects it can run into the same issue as the scheduler does (see https://github.com/apache/airflow/issues/23727).
   
   Our JSON encoder therefore needs to suppress encoding errors arising from pod serialization, and fallback to a default value.
   


-- 
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: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] github-actions[bot] commented on pull request #24478: Return empty dict if Pod JSON encoding fails

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #24478:
URL: https://github.com/apache/airflow/pull/24478#issuecomment-1156858060

   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] potiuk commented on a diff in pull request #24478: Return empty dict if Pod JSON encoding fails

Posted by GitBox <gi...@apache.org>.
potiuk commented on code in PR #24478:
URL: https://github.com/apache/airflow/pull/24478#discussion_r898275293


##########
airflow/utils/json.py:
##########
@@ -81,6 +81,9 @@ def _default(obj):
         elif k8s is not None and isinstance(obj, (k8s.V1Pod, k8s.V1ResourceRequirements)):
             from airflow.kubernetes.pod_generator import PodGenerator
 
-            return PodGenerator.serialize_pod(obj)
+            try:
+                return PodGenerator.serialize_pod(obj)
+            except Exception:

Review Comment:
   I think it makes sense to  log a warning here? 



-- 
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: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] dstandish merged pull request #24478: Return empty dict if Pod JSON encoding fails

Posted by GitBox <gi...@apache.org>.
dstandish merged PR #24478:
URL: https://github.com/apache/airflow/pull/24478


-- 
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: commits-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] dstandish commented on a diff in pull request #24478: Return empty dict if Pod JSON encoding fails

Posted by GitBox <gi...@apache.org>.
dstandish commented on code in PR #24478:
URL: https://github.com/apache/airflow/pull/24478#discussion_r898305607


##########
airflow/utils/json.py:
##########
@@ -81,6 +81,9 @@ def _default(obj):
         elif k8s is not None and isinstance(obj, (k8s.V1Pod, k8s.V1ResourceRequirements)):
             from airflow.kubernetes.pod_generator import PodGenerator
 
-            return PodGenerator.serialize_pod(obj)
+            try:
+                return PodGenerator.serialize_pod(obj)
+            except Exception:

Review Comment:
   sure thing



-- 
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: commits-unsubscribe@airflow.apache.org

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