|
@@ -122,22 +122,22 @@ public class TaskService {
|
|
taskMapper.updateFailStateWithStopTime(taskId, state, TimeUtil.getNowForMysql());
|
|
taskMapper.updateFailStateWithStopTime(taskId, state, TimeUtil.getNowForMysql());
|
|
redisTemplate.delete("podName:" + taskId);
|
|
redisTemplate.delete("podName:" + taskId);
|
|
//result-path-minio: /project/manual-project/
|
|
//result-path-minio: /project/manual-project/
|
|
- String projectId = taskMapper.selectProjectIdById(taskId);
|
|
|
|
- String minioPathOfErrorLog = resultPathMinio + projectId + "/" + taskId + "error.log";
|
|
|
|
- String errorString = MinioUtil.downloadToString(minioClient, bucketName, minioPathOfErrorLog);
|
|
|
|
- String[] lines = errorString.split("\n");
|
|
|
|
- AtomicReference<String> errorMessage = new AtomicReference<>("");
|
|
|
|
- for (String line : lines) {
|
|
|
|
- if (line.startsWith("Original Error")) {
|
|
|
|
- errorMessage.set(errorMessage.get() + line + "\n");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (line.startsWith("Possible Cause")) {
|
|
|
|
- errorMessage.set(errorMessage.get() + line);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- String errorMessageString = errorMessage.get();
|
|
|
|
|
|
+// String projectId = taskMapper.selectProjectIdById(taskId);
|
|
|
|
+// String minioPathOfErrorLog = resultPathMinio + projectId + "/" + taskId + "error.log";
|
|
|
|
+// String errorString = MinioUtil.downloadToString(minioClient, bucketName, minioPathOfErrorLog);
|
|
|
|
+// String[] lines = errorString.split("\n");
|
|
|
|
+// AtomicReference<String> errorMessage = new AtomicReference<>("");
|
|
|
|
+// for (String line : lines) {
|
|
|
|
+// if (line.startsWith("Original Error")) {
|
|
|
|
+// errorMessage.set(errorMessage.get() + line + "\n");
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// if (line.startsWith("Possible Cause")) {
|
|
|
|
+// errorMessage.set(errorMessage.get() + line);
|
|
|
|
+// break;
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// String errorMessageString = errorMessage.get();
|
|
return;
|
|
return;
|
|
} else if ("Terminated".equals(state)) {
|
|
} else if ("Terminated".equals(state)) {
|
|
log.info("TaskService--state 修改任务 " + taskId + "的状态为 Terminated,pod 名称为:" + podName
|
|
log.info("TaskService--state 修改任务 " + taskId + "的状态为 Terminated,pod 名称为:" + podName
|
|
@@ -157,6 +157,11 @@ public class TaskService {
|
|
redisTemplate.delete("podName:" + taskId);
|
|
redisTemplate.delete("podName:" + taskId);
|
|
}
|
|
}
|
|
ProjectPO projectPO = projectMapper.selectById(taskId);
|
|
ProjectPO projectPO = projectMapper.selectById(taskId);
|
|
|
|
+ if (projectPO == null) {
|
|
|
|
+ session.close();
|
|
|
|
+ client.stop();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
String projectId = projectPO.getId();
|
|
String projectId = projectPO.getId();
|
|
Set<String> keys = redisTemplate.keys("manualProject:" + projectId + "*");
|
|
Set<String> keys = redisTemplate.keys("manualProject:" + projectId + "*");
|
|
assert keys != null;
|
|
assert keys != null;
|