Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Change the ENGINE_SEND_LOG_TO_ENTRANCE_LIMIT_ENABLED configuration to be obtained at runtime #684

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import org.apache.linkis.engineconn.acessible.executor.listener.event.{
import org.apache.linkis.engineconn.acessible.executor.log.LogHelper
import org.apache.linkis.engineconn.computation.executor.conf.ComputationExecutorConf
import org.apache.linkis.engineconn.computation.executor.cs.CSTableResultSetWriter
import org.apache.linkis.engineconn.core.EngineConnObject
import org.apache.linkis.engineconn.executor.ExecutorExecutionContext
import org.apache.linkis.engineconn.executor.entity.Executor
import org.apache.linkis.engineconn.executor.listener.{
Expand Down Expand Up @@ -191,15 +192,28 @@ class EngineExecutionContext(executor: ComputationExecutor, executorUser: String
} else {
var taskLog = log
val limitLength = ComputationExecutorConf.ENGINE_SEND_LOG_TO_ENTRANCE_LIMIT_LENGTH.getValue
if (
ComputationExecutorConf.ENGINE_SEND_LOG_TO_ENTRANCE_LIMIT_ENABLED.getValue &&
log.length > limitLength
) {
taskLog = s"${log.substring(0, limitLength)}..."
logger.info("The log is too long and will be intercepted,log limit length : {}", limitLength)
val limitEnableObj =
properties.get(ComputationExecutorConf.ENGINE_SEND_LOG_TO_ENTRANCE_LIMIT_ENABLED.key)
val limitEnable =
if (limitEnableObj == null) {
ComputationExecutorConf.ENGINE_SEND_LOG_TO_ENTRANCE_LIMIT_ENABLED.getValue
} else {
limitEnableObj.toString.toBoolean
}
if (limitEnable) {
if (log.length > limitLength) {
taskLog = s"${log.substring(0, limitLength)}..."
logger.info(
"The log is too long and will be intercepted,log limit length : {}",
limitLength
)
}
}
if (!AccessibleExecutorConfiguration.ENGINECONN_SUPPORT_PARALLELISM.getValue) {
LogHelper.cacheLog(taskLog)
val taskLogs = taskLog.split("\n")
taskLogs.foreach(line => {
LogHelper.cacheLog(line)
})
} else {
val listenerBus = getEngineSyncListenerBus
getJobId.foreach(jId => listenerBus.postToAll(TaskLogUpdateEvent(jId, taskLog)))
Expand Down
Loading