Skip to content

Commit

Permalink
issue-4819: fix illegal ec status and print error log (#4820)
Browse files Browse the repository at this point in the history
* fix ec illegal status

* fix print error log

* update vertion to 1.4.0

* optimized code
  • Loading branch information
aiceflower authored Jul 25, 2023
1 parent 0fa2a56 commit 903996a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,7 @@ object GovernanceCommonConf {
val SCALA_PARSE_APPEND_CODE_ENABLED =
CommonVars("linkis.scala.parse.append.code.enable", true).getValue

val SCALA_PARSE_APPEND_CODE =
CommonVars("linkis.scala.parse.append.code", "val linkisVar=1").getValue

}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ class ScalaCodeParser extends SingleCodeParser with Logging {
if (statementBuffer.nonEmpty) codeBuffer.append(statementBuffer.mkString("\n"))

// Append code `val linkisVar=1` in ends to prevent bugs that do not exit tasks for a long time
if (GovernanceCommonConf.SCALA_PARSE_APPEND_CODE_ENABLED) codeBuffer.append("val linkisVar=1")
if (GovernanceCommonConf.SCALA_PARSE_APPEND_CODE_ENABLED) {
codeBuffer.append(GovernanceCommonConf.SCALA_PARSE_APPEND_CODE)
}
codeBuffer.toArray
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void addOrupdateNodeMetrics(NodeMetrics nodeMetrics) {
"ignore update ShuttingDown status node:{} to status:{}",
instance,
NodeStatus.values()[nodeMetrics.getStatus()].name());
persistenceNodeMetrics.setStatus(null);
persistenceNodeMetrics.setStatus(oldMetrics.getStatus());
} else {
persistenceNodeMetrics.setStatus(nodeMetrics.getStatus());
}
Expand Down
2 changes: 1 addition & 1 deletion linkis-dist/deploy-config/linkis-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export SERVER_HEAP_SIZE="512M"
##The extended lib such mysql-connector-java-*.jar
#LINKIS_EXTENDED_LIB=/appcom/common/linkisExtendedLib

LINKIS_VERSION=1.3.2
LINKIS_VERSION=1.4.0

# for install
LINKIS_PUBLIC_MODULE=lib/linkis-commons/public-module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ object SparkConfiguration extends Logging {

val LINKIS_SPARK_ETL_SUPPORT_HUDI = CommonVars[Boolean]("linkis.spark.etl.support.hudi", false)

val SCALA_PARSE_APPEND_CODE =
CommonVars("linkis.scala.parse.append.code", "val linkisVar=1").getValue

private def getMainJarName(): String = {
val somePath = ClassUtils.jarOfClass(classOf[SparkEngineConnFactory])
if (somePath.isDefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ class MDQPostExecutionHook extends SparkPostExecutionHook with Logging {
case l: CodeLanguageLabel => l.getCodeType
case _ => ""
}
if (StringUtils.isEmpty(runType) || !SparkKind.FUNCTION_MDQ_TYPE.equalsIgnoreCase(runType)) {
if (
StringUtils.isEmpty(runType) || !SparkKind.FUNCTION_MDQ_TYPE.equalsIgnoreCase(
runType
) || (code != null && code.contains(SparkConfiguration.SCALA_PARSE_APPEND_CODE))
) {
return
}
val sender = Sender.getSender(SparkConfiguration.MDQ_APPLICATION_NAME.getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ class MDQPreExecutionHook extends SparkPreExecutionHook with Logging {
case _ =>
""
}
if (StringUtils.isEmpty(runType) || !SparkKind.FUNCTION_MDQ_TYPE.equalsIgnoreCase(runType)) {
if (
StringUtils.isEmpty(runType) || !SparkKind.FUNCTION_MDQ_TYPE.equalsIgnoreCase(
runType
) || (code != null && code.contains(SparkConfiguration.SCALA_PARSE_APPEND_CODE))
) {
return code
}
val sender = Sender.getSender(SparkConfiguration.MDQ_APPLICATION_NAME.getValue)
Expand Down
2 changes: 1 addition & 1 deletion linkis-web/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ VUE_APP_HOST=
BACKEND_URL=http://127.0.0.1:9001
VUE_APP_MN_CONFIG_PREFIX=
VUE_APP_MN_CONFIG_SOCKET=/ws/api/entrance/connect
VUE_APP_VERSION=1.3.2
VUE_APP_VERSION=1.4.0

0 comments on commit 903996a

Please sign in to comment.