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/08/25 09:38:26 UTC

[GitHub] [airflow] stijndehaes commented on issue #10544: Kubernetes pod operator: More than one pod running with labels

stijndehaes commented on issue #10544:
URL: https://github.com/apache/airflow/issues/10544#issuecomment-679919233


   Looking at the code I notice a discrepancy between master and release 1.10.11.
   
   In master I find this:
   ```python
               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:
                   self.log.info("creating pod with labels %s and launcher %s", labels, launcher)
                   final_state, _, result = self.create_new_pod_for_operator(labels, launcher)
   ```
   
   on 1.10.11:
   
   ```python
               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.create_new_pod_for_operator(labels, launcher)
               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[0])
               else:
                   final_state, _, result = self.create_new_pod_for_operator(labels, launcher)
   ```
   
   So in the first use case on master we will always attach to the pod, and on 1.10.11 we will create a new pod. I assume that 1.10.11 is the behaviour you want however. Because in master it will never ever launch a new pod when the pod has failed it will just monitor the old one and fail again.


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