Skip to content

Commit

Permalink
[Optimization]Fix the issue that clusters are not automatically delet…
Browse files Browse the repository at this point in the history
…ed in app mode (DataLinkDC#3374)

Co-authored-by: gaoyan1998 <gaoyan1998@users.noreply.github.com>
  • Loading branch information
2 people authored and Zzm0809 committed May 6, 2024
1 parent 27fdf6b commit 090450c
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,23 @@ public static void monitorFlinkTask(JobClient jobClient, int taskId) {
*/
private static void sendHook(int taskId, String jobId, int reTryCount) {
String dinkyAddr = SystemConfiguration.getInstances().getDinkyAddr().getValue();
String url = StrFormatter.format("{}/api/jobInstance/hookJobDone?taskId={}&jobId={}", dinkyAddr, taskId, jobId);
try {
String url =
StrFormatter.format("{}/api/jobInstance/hookJobDone?taskId={}&jobId={}", dinkyAddr, taskId, jobId);
String resultStr = HttpUtil.get(url);
String resultStr = HttpUtil.get(url, 5000);
// TODO 这里应该使用Result实体类,但是Result.class不在comm里,迁移改动太大,暂时不搞
String code = JsonUtils.parseObject(resultStr).get("code").toString();
if (!"0".equals(code)) {
throw new RuntimeException(
StrFormatter.format("Send Hook Job Done result failed,url:{},err:{} ", url, resultStr));
}
} catch (Exception e) {
if (reTryCount < 30) {
log.error("send hook failed,retry later taskId:{},jobId:{},{}", taskId, jobId, e.getMessage());
if (reTryCount < 10) {
log.error(
"send hook failed,retry later,url:{}, taskId:{},jobId:{},{}",
url,
taskId,
jobId,
e.getMessage());
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
Expand Down

0 comments on commit 090450c

Please sign in to comment.