Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
tool
/
xxl-job
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 998da25c
authored
Jun 20, 2019
by
xuxueli
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
调度中心与执行器双向通讯超时时间调整为3s
1 parent
e45d7525
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
15 deletions
doc/XXL-JOB官方文档.md
xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobScheduler.java
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
xxl-job-admin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java
xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java
xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java
doc/XXL-JOB官方文档.md
View file @
998da25
...
@@ -853,8 +853,8 @@ XXL-JOB的每个调度任务虽然在调度模块是并行调度执行的,但
...
@@ -853,8 +853,8 @@ XXL-JOB的每个调度任务虽然在调度模块是并行调度执行的,但
任务调度错过触发时间时的处理策略:
任务调度错过触发时间时的处理策略:
-
可能原因:服务重启;调度线程被阻塞,线程被耗尽;上次调度持续阻塞,下次调度被错过;
-
可能原因:服务重启;调度线程被阻塞,线程被耗尽;上次调度持续阻塞,下次调度被错过;
-
处理策略:
-
处理策略:
-
过期超
10
s:本地忽略,当前时间开始计算下次触发时间
-
过期超
5
s:本地忽略,当前时间开始计算下次触发时间
-
过期超过5s:过期
10
s内:立即触发一次,当前时间开始计算下次触发时间
-
过期超过5s:过期
5
s内:立即触发一次,当前时间开始计算下次触发时间
#### 5.4.7 日志回调服务
#### 5.4.7 日志回调服务
...
@@ -1476,6 +1476,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
...
@@ -1476,6 +1476,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
-
10、项目依赖升级至较新稳定版本,如spring、springboot、groovy、xxl-rpc等等;并清理冗余POM;
-
10、项目依赖升级至较新稳定版本,如spring、springboot、groovy、xxl-rpc等等;并清理冗余POM;
-
11、升级xxl-rpc至较新版本,修复代理服务初始化时远程服务不可用导致长连冗余创建的问题;
-
11、升级xxl-rpc至较新版本,修复代理服务初始化时远程服务不可用导致长连冗余创建的问题;
-
12、首页调度报表的日期排序在TIDB下乱序问题修复;
-
12、首页调度报表的日期排序在TIDB下乱序问题修复;
-
13、调度中心与执行器双向通讯超时时间调整为3s;
### 6.26 版本 v2.1.1 Release Notes[规划中]
### 6.26 版本 v2.1.1 Release Notes[规划中]
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobScheduler.java
View file @
998da25
...
@@ -134,7 +134,7 @@ public class XxlJobScheduler implements InitializingBean, DisposableBean {
...
@@ -134,7 +134,7 @@ public class XxlJobScheduler implements InitializingBean, DisposableBean {
LoadBalance
.
ROUND
,
LoadBalance
.
ROUND
,
ExecutorBiz
.
class
,
ExecutorBiz
.
class
,
null
,
null
,
5
000
,
3
000
,
address
,
address
,
XxlJobAdminConfig
.
getAdminConfig
().
getAccessToken
(),
XxlJobAdminConfig
.
getAdminConfig
().
getAccessToken
(),
null
,
null
,
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java
View file @
998da25
...
@@ -63,8 +63,8 @@ public class JobScheduleHelper {
...
@@ -63,8 +63,8 @@ public class JobScheduleHelper {
// tx start
// tx start
// 1、预读
10
s内调度任务
// 1、预读
5
s内调度任务
long
maxNextTime
=
System
.
currentTimeMillis
()
+
10
000
;
long
maxNextTime
=
System
.
currentTimeMillis
()
+
5
000
;
long
nowTime
=
System
.
currentTimeMillis
();
long
nowTime
=
System
.
currentTimeMillis
();
List
<
XxlJobInfo
>
scheduleList
=
XxlJobAdminConfig
.
getAdminConfig
().
getXxlJobInfoDao
().
scheduleJobQuery
(
maxNextTime
);
List
<
XxlJobInfo
>
scheduleList
=
XxlJobAdminConfig
.
getAdminConfig
().
getXxlJobInfoDao
().
scheduleJobQuery
(
maxNextTime
);
if
(
scheduleList
!=
null
&&
scheduleList
.
size
()>
0
)
{
if
(
scheduleList
!=
null
&&
scheduleList
.
size
()>
0
)
{
...
@@ -73,7 +73,7 @@ public class JobScheduleHelper {
...
@@ -73,7 +73,7 @@ public class JobScheduleHelper {
// 时间轮刻度计算
// 时间轮刻度计算
int
ringSecond
=
-
1
;
int
ringSecond
=
-
1
;
if
(
jobInfo
.
getTriggerNextTime
()
<
nowTime
-
10000
)
{
// 过期超10
s:本地忽略,当前时间开始计算下次触发时间
if
(
jobInfo
.
getTriggerNextTime
()
<
nowTime
-
5000
)
{
// 过期超5
s:本地忽略,当前时间开始计算下次触发时间
ringSecond
=
-
1
;
ringSecond
=
-
1
;
jobInfo
.
setTriggerLastTime
(
jobInfo
.
getTriggerNextTime
());
jobInfo
.
setTriggerLastTime
(
jobInfo
.
getTriggerNextTime
());
...
@@ -82,7 +82,7 @@ public class JobScheduleHelper {
...
@@ -82,7 +82,7 @@ public class JobScheduleHelper {
.
getNextValidTimeAfter
(
new
Date
())
.
getNextValidTimeAfter
(
new
Date
())
.
getTime
()
.
getTime
()
);
);
}
else
if
(
jobInfo
.
getTriggerNextTime
()
<
nowTime
)
{
// 过期
10
s内:立即触发一次,当前时间开始计算下次触发时间
}
else
if
(
jobInfo
.
getTriggerNextTime
()
<
nowTime
)
{
// 过期
5
s内:立即触发一次,当前时间开始计算下次触发时间
ringSecond
=
(
int
)((
nowTime
/
1000
)%
60
);
ringSecond
=
(
int
)((
nowTime
/
1000
)%
60
);
jobInfo
.
setTriggerLastTime
(
jobInfo
.
getTriggerNextTime
());
jobInfo
.
setTriggerLastTime
(
jobInfo
.
getTriggerNextTime
());
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
View file @
998da25
...
@@ -189,11 +189,11 @@ public class XxlJobServiceImpl implements XxlJobService {
...
@@ -189,11 +189,11 @@ public class XxlJobServiceImpl implements XxlJobService {
return
new
ReturnT
<
String
>(
ReturnT
.
FAIL_CODE
,
(
I18nUtil
.
getString
(
"jobinfo_field_id"
)+
I18nUtil
.
getString
(
"system_not_found"
))
);
return
new
ReturnT
<
String
>(
ReturnT
.
FAIL_CODE
,
(
I18nUtil
.
getString
(
"jobinfo_field_id"
)+
I18nUtil
.
getString
(
"system_not_found"
))
);
}
}
// next trigger time (
10
s后生效,避开预读周期)
// next trigger time (
5
s后生效,避开预读周期)
long
nextTriggerTime
=
exists_jobInfo
.
getTriggerNextTime
();
long
nextTriggerTime
=
exists_jobInfo
.
getTriggerNextTime
();
if
(
exists_jobInfo
.
getTriggerStatus
()
==
1
&&
!
jobInfo
.
getJobCron
().
equals
(
exists_jobInfo
.
getJobCron
())
)
{
if
(
exists_jobInfo
.
getTriggerStatus
()
==
1
&&
!
jobInfo
.
getJobCron
().
equals
(
exists_jobInfo
.
getJobCron
())
)
{
try
{
try
{
nextTriggerTime
=
new
CronExpression
(
jobInfo
.
getJobCron
()).
getNextValidTimeAfter
(
new
Date
(
System
.
currentTimeMillis
()
+
10
000
)).
getTime
();
nextTriggerTime
=
new
CronExpression
(
jobInfo
.
getJobCron
()).
getNextValidTimeAfter
(
new
Date
(
System
.
currentTimeMillis
()
+
5
000
)).
getTime
();
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
return
new
ReturnT
<
String
>(
ReturnT
.
FAIL_CODE
,
I18nUtil
.
getString
(
"jobinfo_field_cron_unvalid"
)+
" | "
+
e
.
getMessage
());
return
new
ReturnT
<
String
>(
ReturnT
.
FAIL_CODE
,
I18nUtil
.
getString
(
"jobinfo_field_cron_unvalid"
)+
" | "
+
e
.
getMessage
());
...
@@ -236,10 +236,10 @@ public class XxlJobServiceImpl implements XxlJobService {
...
@@ -236,10 +236,10 @@ public class XxlJobServiceImpl implements XxlJobService {
public
ReturnT
<
String
>
start
(
int
id
)
{
public
ReturnT
<
String
>
start
(
int
id
)
{
XxlJobInfo
xxlJobInfo
=
xxlJobInfoDao
.
loadById
(
id
);
XxlJobInfo
xxlJobInfo
=
xxlJobInfoDao
.
loadById
(
id
);
// next trigger time (
10
s后生效,避开预读周期)
// next trigger time (
5
s后生效,避开预读周期)
long
nextTriggerTime
=
0
;
long
nextTriggerTime
=
0
;
try
{
try
{
nextTriggerTime
=
new
CronExpression
(
xxlJobInfo
.
getJobCron
()).
getNextValidTimeAfter
(
new
Date
(
System
.
currentTimeMillis
()
+
10
000
)).
getTime
();
nextTriggerTime
=
new
CronExpression
(
xxlJobInfo
.
getJobCron
()).
getNextValidTimeAfter
(
new
Date
(
System
.
currentTimeMillis
()
+
5
000
)).
getTime
();
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
return
new
ReturnT
<
String
>(
ReturnT
.
FAIL_CODE
,
I18nUtil
.
getString
(
"jobinfo_field_cron_unvalid"
)+
" | "
+
e
.
getMessage
());
return
new
ReturnT
<
String
>(
ReturnT
.
FAIL_CODE
,
I18nUtil
.
getString
(
"jobinfo_field_cron_unvalid"
)+
" | "
+
e
.
getMessage
());
...
...
xxl-job-admin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java
View file @
998da25
...
@@ -39,7 +39,7 @@ public class AdminBizTest {
...
@@ -39,7 +39,7 @@ public class AdminBizTest {
LoadBalance
.
ROUND
,
LoadBalance
.
ROUND
,
AdminBiz
.
class
,
AdminBiz
.
class
,
null
,
null
,
10
000
,
3
000
,
addressUrl
,
addressUrl
,
accessToken
,
accessToken
,
null
,
null
,
...
@@ -69,7 +69,7 @@ public class AdminBizTest {
...
@@ -69,7 +69,7 @@ public class AdminBizTest {
LoadBalance
.
ROUND
,
LoadBalance
.
ROUND
,
AdminBiz
.
class
,
AdminBiz
.
class
,
null
,
null
,
10
000
,
3
000
,
addressUrl
,
addressUrl
,
accessToken
,
accessToken
,
null
,
null
,
...
...
xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java
View file @
998da25
...
@@ -56,7 +56,7 @@ public class ExecutorBizTest {
...
@@ -56,7 +56,7 @@ public class ExecutorBizTest {
LoadBalance
.
ROUND
,
LoadBalance
.
ROUND
,
ExecutorBiz
.
class
,
ExecutorBiz
.
class
,
null
,
null
,
10
000
,
3
000
,
"127.0.0.1:9999"
,
"127.0.0.1:9999"
,
null
,
null
,
null
,
null
,
...
...
xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java
View file @
998da25
...
@@ -127,7 +127,7 @@ public class XxlJobExecutor {
...
@@ -127,7 +127,7 @@ public class XxlJobExecutor {
LoadBalance
.
ROUND
,
LoadBalance
.
ROUND
,
AdminBiz
.
class
,
AdminBiz
.
class
,
null
,
null
,
10
000
,
3
000
,
addressUrl
,
addressUrl
,
accessToken
,
accessToken
,
null
,
null
,
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment