From c071a63f14db68f77799755c84a1d2502b861d45 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Tue, 26 Feb 2019 15:04:53 +0800 Subject: [PATCH] =?UTF-8?q?JobHandler#msg=E9=95=BF=E5=BA=A6=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=BC=82=E5=B8=B8=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E6=97=A5=E5=BF=97=E8=B6=85=E9=95=BF=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=86=85=E5=AD=98=E6=BA=A2=E5=87=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 2 +- .../src/main/java/com/xxl/job/core/thread/JobThread.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 6bf25634..d4774eea 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1434,7 +1434,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 18、调度日志排序逻辑调整为按照调度时间倒序,兼容TIDB等主键不连续日志存储组件; - 19、执行器优雅停机优化; - 20、连接池配置优化,增强连接有效性验证; -- 21、[迭代中]JobHandler执行结果日志长度限制: +- 21、JobHandler#msg长度限制,修复异常情况下日志超长导致内存溢出的问题; - 22、[迭代中]执行器端口复用: - 23、[迭代中]任务线程隔离: - 执行器测异步响应,不存在阻塞不需要隔离; diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/thread/JobThread.java b/xxl-job-core/src/main/java/com/xxl/job/core/thread/JobThread.java index 290b7e54..c1f2b640 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/thread/JobThread.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/thread/JobThread.java @@ -154,6 +154,9 @@ public class JobThread extends Thread{ if (executeResult == null) { executeResult = IJobHandler.FAIL; + } else { + executeResult.setMsg((executeResult!=null&&executeResult.getMsg().length()>50000)?executeResult.getMsg().substring(0, 50000).concat("..."):executeResult.getMsg()); + executeResult.setContent(null); // limit obj size } XxlJobLogger.log("
----------- xxl-job job execute end(finish) -----------
----------- ReturnT:" + executeResult);