Skip to content

Commit

Permalink
[AMORO-3367] Avoid throwing StringIndexOutOfBoundsException in flink …
Browse files Browse the repository at this point in the history
…optimizer executors (#3368)

Co-authored-by: ZhouJinsong <[email protected]>
  • Loading branch information
XBaith and zhoujinsong authored Dec 20, 2024
1 parent a66fe6a commit cf95293
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ protected OptimizingTaskResult executeTask(OptimizingTask task) {
if (runtimeContext != null && !runtimeContext.isEmpty()) {
runtimeContext.forEach((k, v) -> sb.append(k).append("=").append(v).append("\n"));
}
String errorMsg = sb + result.getErrorMessage();
result.setErrorMessage(
(sb + result.getErrorMessage()).substring(0, ERROR_MESSAGE_MAX_LENGTH));
errorMsg.substring(0, Math.min(ERROR_MESSAGE_MAX_LENGTH, errorMsg.length())));
}
return result;
}
Expand Down

0 comments on commit cf95293

Please sign in to comment.