Skip to content

Commit

Permalink
Fix flink sql kill yarn application and getJobStatus fail (#5041)
Browse files Browse the repository at this point in the history
* Fix flink getJobStatus bug

* Fix flink sql kill yarn application and getJobStatus fail
  • Loading branch information
ChengJie1053 authored Dec 14, 2023
1 parent f811794 commit 14e118a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ class TaskExecutionServiceImpl
if (null != task) {
sendToEntrance(task, ResponseTaskLog(logUpdateEvent.taskId, logUpdateEvent.log))
} else {
logger.error("Task cannot null! logupdateEvent: " + logUpdateEvent.taskId)
logger.warn("Task cannot null! logupdateEvent: " + logUpdateEvent.taskId)
}
} else if (null != lastTask) {
val executor = executorManager.getReportExecutor
Expand Down Expand Up @@ -733,7 +733,7 @@ class TaskExecutionServiceImpl
if (null != executor) {
executor.getTaskById(taskId)
} else {
logger.error(s"Executor of taskId : $taskId is not cached.")
logger.warn(s"Executor of taskId : $taskId is not cached.")
null
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ public ClusterDescriptorAdapter(ExecutionContext executionContext) {

/** Returns the status of the flink job. */
public JobStatus getJobStatus() throws JobExecutionException {
if (jobId == null) {
try {
LOG.info("flink getJobStatus jobId is null,sleep three seconds");
Thread.sleep(3000);
} catch (InterruptedException e) {

}
}
LOG.info("flink getJobStatus jobId:{}", jobId);
if (jobId == null) {
throw new JobExecutionException(NO_JOB_SUBMITTED.getErrorDesc());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ class FlinkSQLComputationExecutor(
super.close()
}

override def tryShutdown(): Boolean = {
Utils.tryAndWarn(close())
super.tryShutdown()
}

}

class FlinkSQLStatusListener(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<loggers>
<root level="INFO">
<appender-ref ref="stderr"/>
<appender-ref ref="Console"/>
<appender-ref ref="RollingFile"/>
<appender-ref ref="Send"/>
</root>
<logger name="org.apache.hadoop.hive.ql.exec.StatsTask" level="info" additivity="true">
Expand Down

0 comments on commit 14e118a

Please sign in to comment.