potiuk commented on code in PR #72068:
URL: https://github.com/apache/airflow/pull/72068#discussion_r4062478585
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -986,7 +995,16 @@ def extract_xcom(self, pod: V1Pod) -> str:
result = self.extract_xcom_json(pod)
return result
finally:
- self.extract_xcom_kill(pod)
+ try:
+ self.extract_xcom_kill(pod)
+ except PodCommandException as e:
Review Comment:
Small follow-up rather than a blocker, since it's the same symptom arriving
by a different route: `extract_xcom_kill` is decorated `@generic_api_retry`,
which "retries only transient ApiException status codes" and re-raises
otherwise (`kubernetes_helper_functions.py:97-110`). So an RBAC denial on the
`pods/exec` subresource (403) or a vanished pod (404) comes out as an
`ApiException`, slips past this `except`, and discards the XCom exactly as the
bug you're fixing does.
`ApiException` is already imported at line 36, so it's a one-word widening:
```suggestion
except (PodCommandException, ApiException) as e:
```
--
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]