|
|
@ -4,7 +4,6 @@ import com.xxl.job.core.handler.IJobHandler;
|
|
|
|
import com.xxl.job.core.handler.IJobHandler.JobHandleStatus;
|
|
|
|
import com.xxl.job.core.handler.IJobHandler.JobHandleStatus;
|
|
|
|
import com.xxl.job.core.log.XxlJobFileAppender;
|
|
|
|
import com.xxl.job.core.log.XxlJobFileAppender;
|
|
|
|
import com.xxl.job.core.router.model.RequestModel;
|
|
|
|
import com.xxl.job.core.router.model.RequestModel;
|
|
|
|
import com.xxl.job.core.util.XxlJobNetCommUtil;
|
|
|
|
|
|
|
|
import org.eclipse.jetty.util.ConcurrentHashSet;
|
|
|
|
import org.eclipse.jetty.util.ConcurrentHashSet;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
@ -88,7 +87,7 @@ public class JobThread extends Thread{
|
|
|
|
e.printStackTrace(new PrintWriter(out));
|
|
|
|
e.printStackTrace(new PrintWriter(out));
|
|
|
|
_msg = out.toString();
|
|
|
|
_msg = out.toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
logger.info("----------- xxl-job job handle end ----------- <br>: ExecutorParams:{}, Status:{}, Msg:{}",
|
|
|
|
logger.info("----------- xxl-job job handle end ----------- <br> Look : ExecutorParams:{}, Status:{}, Msg:{}",
|
|
|
|
new Object[]{handlerParams, _status, _msg});
|
|
|
|
new Object[]{handlerParams, _status, _msg});
|
|
|
|
|
|
|
|
|
|
|
|
// callback handler info
|
|
|
|
// callback handler info
|
|
|
@ -100,7 +99,7 @@ public class JobThread extends Thread{
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// is killed
|
|
|
|
// is killed
|
|
|
|
triggerDate.setStatus(JobHandleStatus.FAIL.name());
|
|
|
|
triggerDate.setStatus(JobHandleStatus.FAIL.name());
|
|
|
|
triggerDate.setMsg(stopReason + "人工手动终止[业务运行中,被强制终止]");
|
|
|
|
triggerDate.setMsg(stopReason + " [业务运行中,被强制终止]");
|
|
|
|
TriggerCallbackThread.pushCallBack(triggerDate);
|
|
|
|
TriggerCallbackThread.pushCallBack(triggerDate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -114,12 +113,9 @@ public class JobThread extends Thread{
|
|
|
|
RequestModel triggerDate = triggerQueue.poll();
|
|
|
|
RequestModel triggerDate = triggerQueue.poll();
|
|
|
|
if (triggerDate!=null) {
|
|
|
|
if (triggerDate!=null) {
|
|
|
|
// is killed
|
|
|
|
// is killed
|
|
|
|
RequestModel callback = new RequestModel();
|
|
|
|
triggerDate.setStatus(JobHandleStatus.FAIL.name());
|
|
|
|
callback.setLogAddress(XxlJobNetCommUtil.addressToUrl(triggerDate.getLogAddress()));
|
|
|
|
triggerDate.setMsg(stopReason + " [任务尚未执行,在调度队列中被终止]");
|
|
|
|
callback.setLogId(triggerDate.getLogId());
|
|
|
|
TriggerCallbackThread.pushCallBack(triggerDate);
|
|
|
|
callback.setStatus(JobHandleStatus.FAIL.name());
|
|
|
|
|
|
|
|
callback.setMsg(stopReason + "[任务尚未执行,在调度队列中被终止]");
|
|
|
|
|
|
|
|
TriggerCallbackThread.pushCallBack(callback);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|