[
https://issues.apache.org/jira/browse/KYLIN-5246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17628080#comment-17628080
]
ASF GitHub Bot commented on KYLIN-5246:
---------------------------------------
shaofengshi commented on code in PR #2013:
URL: https://github.com/apache/kylin/pull/2013#discussion_r1012449086
##########
core-common/src/main/java/org/apache/kylin/common/util/CliCommandExecutor.java:
##########
@@ -164,7 +164,8 @@ private Pair<Integer, String> runNativeCommand(String
command, Logger logAppende
try {
int exitCode = proc.waitFor();
- return Pair.newPair(exitCode, result.toString());
+ String info = exitCode != 0 ? "Job execute failed, see kylin
log or spark log for more info." : "Success";
+ return Pair.newPair(exitCode, info);
Review Comment:
This changed the behavior, may cause more issues.
Suggestion: how about adding a max. cap to the "result" buffer, so that only
print out the last X characters, say 1K or 10K.
> long running job's log staying in mem, may cause job server oom
> ---------------------------------------------------------------
>
> Key: KYLIN-5246
> URL: https://issues.apache.org/jira/browse/KYLIN-5246
> Project: Kylin
> Issue Type: Improvement
> Components: Job Engine
> Affects Versions: v4.0.1
> Reporter: Liu Zhao
> Priority: Minor
>
> {code:java}
> CliCommandExecutor
> --------
> BufferedReader reader = new BufferedReader(
> new InputStreamReader(proc.getInputStream(),
> StandardCharsets.UTF_8));
> String line;
> StringBuilder result = new StringBuilder();
> while ((line = reader.readLine()) != null &&
> !Thread.currentThread().isInterrupted()) {
> result.append(line).append('\n');
> if (logAppender != null) {
> logAppender.log(line);
> }
> }
> {code}
> job运行时间久,result 会非常大,可能会引起内存问题
--
This message was sent by Atlassian Jira
(v8.20.10#820010)