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