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 2020/07/29 07:58:49 UTC
[GitHub] [airflow] fabien-sarcel commented on issue #10021: Remove try_number check to decide whether to monitor or create new POD for K8sPodOperator
fabien-sarcel commented on issue #10021:
URL: https://github.com/apache/airflow/issues/10021#issuecomment-665166594
It seems to me that the try_number check can be useful, but v1.10.11 doesn't behave properly due to implementation errors.
In order to get the "expected behaviour", the first conditional step needs to run monitor_launched_pod (instead of create_new_pod_for_operator). And there is another error on the second conditional step, monitor_launched_pod need to be called with pod_list.items[0] instead of pod_list[0].
```
if len(pod_list.items) == 1 and \
self._try_numbers_do_not_match(context, pod_list.items[0]) and \
self.reattach_on_restart:
self.log.info("found a running pod with labels %s but a different try_number"
"Will attach to this pod and monitor instead of starting new one", labels)
final_state, result = self.monitor_launched_pod(launcher, pod_list.items[0])
elif len(pod_list.items) == 1:
self.log.info("found a running pod with labels %s."
"Will monitor this pod instead of starting new one", labels)
final_state, result = self.monitor_launched_pod(launcher, pod_list.items[0])
else:
final_state, _, result = self.create_new_pod_for_operator(labels, launcher)
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org