Radeity commented on code in PR #14379:
URL: 
https://github.com/apache/dolphinscheduler/pull/14379#discussion_r1260497273


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/am/KubernetesApplicationManager.java:
##########
@@ -97,16 +101,20 @@ public ResourceManagerType getResourceManagerType() {
      * @param kubernetesApplicationManagerContext
      * @return
      */
-    private FilterWatchListDeletable<Pod, PodList, PodResource> 
getDriverPod(KubernetesApplicationManagerContext 
kubernetesApplicationManagerContext) {
+    private FilterWatchListDeletable<Pod, PodList, PodResource> 
getListenPod(KubernetesApplicationManagerContext 
kubernetesApplicationManagerContext) {
         KubernetesClient client = 
getClient(kubernetesApplicationManagerContext);
         String labelValue = 
kubernetesApplicationManagerContext.getLabelValue();
-        FilterWatchListDeletable<Pod, PodList, PodResource> watchList = 
client.pods()
-                
.inNamespace(kubernetesApplicationManagerContext.getK8sTaskExecutionContext().getNamespace())
-                .withLabel(UNIQUE_LABEL_NAME, labelValue);
-        List<Pod> podList = watchList.list().getItems();
-        if (podList.size() != 1) {
-            log.warn("Expected driver pod 1, but get {}.", podList.size());
+        List<Pod> podList = null;
+        FilterWatchListDeletable<Pod, PodList, PodResource> watchList = null;
+        int retryTimes = 0;
+        while (CollectionUtils.isEmpty(podList) && retryTimes < 
MAX_RETRY_TIMES) {
+            watchList = client.pods()
+                    
.inNamespace(kubernetesApplicationManagerContext.getK8sTaskExecutionContext().getNamespace())
+                    .withLabel(UNIQUE_LABEL_NAME, labelValue);
+            podList = watchList.list().getItems();
+            retryTimes += 1;

Review Comment:
   Oh sorry, I forgot to add this, thanks for your reminder!



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

Reply via email to