wangxj3 commented on code in PR #17510:
URL:
https://github.com/apache/dolphinscheduler/pull/17510#discussion_r2350964839
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/am/KubernetesApplicationManager.java:
##########
@@ -166,14 +220,34 @@ private TaskExecutionStatus
getApplicationStatus(KubernetesApplicationManagerCon
if (Objects.isNull(watchList)) {
watchList = getListenPod(kubernetesApplicationManagerContext);
}
- List<Pod> driverPod = watchList.list().getItems();
- if (!driverPod.isEmpty()) {
- // cluster mode
- Pod driver = driverPod.get(0);
- phase = driver.getStatus().getPhase();
- } else {
- // client mode
- phase = FINISH;
+
+ // To avoid the possibility of watchList expiration, retrieve the
client again to perform the list operation
+ String clusterId =
getClusterId(kubernetesApplicationManagerContext.getK8sTaskExecutionContext());
+ KubernetesClient client = null;
+ try {
+ client = getClient(kubernetesApplicationManagerContext);
+ String labelValue =
kubernetesApplicationManagerContext.getLabelValue();
+
+ // Build the latest watchList again
+ FilterWatchListDeletable<Pod, PodList, PodResource>
newWatchList =
Review Comment:
this is a new newWatchList?
--
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]