Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
c76087de
Unverified
Commit
c76087de
authored
Dec 13, 2023
by
gaoyan
Committed by
GitHub
Dec 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Transition (#2636)
* fix Transition * fix Transition
parent
40343025
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
JobRefreshHandler.java
...rc/main/java/org/dinky/job/handler/JobRefreshHandler.java
+20
-9
StatusTag.tsx
dinky-web/src/components/JobTags/StatusTag.tsx
+2
-2
No files found.
dinky-admin/src/main/java/org/dinky/job/handler/JobRefreshHandler.java
View file @
c76087de
...
@@ -113,11 +113,13 @@ public class JobRefreshHandler {
...
@@ -113,11 +113,13 @@ public class JobRefreshHandler {
if
(
Asserts
.
isNull
(
jobDataDto
.
getJob
())
||
jobDataDto
.
isError
())
{
if
(
Asserts
.
isNull
(
jobDataDto
.
getJob
())
||
jobDataDto
.
isError
())
{
// If the job fails to get it, the default Finish Time is the current time
// If the job fails to get it, the default Finish Time is the current time
jobInstance
.
setStatus
(
JobStatus
.
UNKNOWN
.
getValue
());
jobInstance
.
setStatus
(
JobStatus
.
RECONNECTING
.
getValue
());
jobInstance
.
setFinishTime
(
LocalDateTime
.
now
());
jobInstance
.
setError
(
jobDataDto
.
getErrorMsg
());
jobInstance
.
setError
(
jobDataDto
.
getErrorMsg
());
jobInfoDetail
.
getJobDataDto
().
setError
(
true
);
jobInfoDetail
.
getJobDataDto
().
setError
(
true
);
jobInfoDetail
.
getJobDataDto
().
setErrorMsg
(
jobDataDto
.
getErrorMsg
());
jobInfoDetail
.
getJobDataDto
().
setErrorMsg
(
jobDataDto
.
getErrorMsg
());
if
(
TimeUtil
.
localDateTimeToLong
(
jobInstance
.
getFinishTime
())
<
1
)
{
jobInstance
.
setFinishTime
(
LocalDateTime
.
now
());
}
}
else
{
}
else
{
jobInfoDetail
.
setJobDataDto
(
jobDataDto
);
jobInfoDetail
.
setJobDataDto
(
jobDataDto
);
FlinkJobDetailInfo
flinkJobDetailInfo
=
jobDataDto
.
getJob
();
FlinkJobDetailInfo
flinkJobDetailInfo
=
jobDataDto
.
getJob
();
...
@@ -139,15 +141,22 @@ public class JobRefreshHandler {
...
@@ -139,15 +141,22 @@ public class JobRefreshHandler {
// If the job status is transition and the status fails to be updated for 1 minute, set to true and discard the
// If the job status is transition and the status fails to be updated for 1 minute, set to true and discard the
// update
// update
boolean
isTransition
=
JobStatus
.
isTransition
(
jobInstance
.
getStatus
())
boolean
isTransition
=
false
;
&&
(
TimeUtil
.
localDateTimeToLong
(
jobInstance
.
getFinishTime
())
>
0
&&
Duration
.
between
(
jobInstance
.
getFinishTime
(),
LocalDateTime
.
now
())
.
toMinutes
()
<
1
);
if
(
isTransition
)
{
if
(
JobStatus
.
isTransition
(
jobInstance
.
getStatus
()))
{
Long
finishTime
=
TimeUtil
.
localDateTimeToLong
(
jobInstance
.
getFinishTime
());
long
duration
=
Duration
.
between
(
jobInstance
.
getFinishTime
(),
LocalDateTime
.
now
())
.
toMinutes
();
if
(
finishTime
>
0
&&
duration
<
1
)
{
log
.
debug
(
"Job is transition: {}->{}"
,
jobInstance
.
getId
(),
jobInstance
.
getName
());
log
.
debug
(
"Job is transition: {}->{}"
,
jobInstance
.
getId
(),
jobInstance
.
getName
());
return
false
;
isTransition
=
true
;
}
else
if
(
JobStatus
.
RECONNECTING
.
getValue
().
equals
(
jobInstance
.
getStatus
()))
{
log
.
debug
(
"Job is not reconnected success at the specified time,set as UNKNOWN: {}->{}"
,
jobInstance
.
getId
(),
jobInstance
.
getName
());
jobInstance
.
setStatus
(
JobStatus
.
UNKNOWN
.
getValue
());
}
}
}
boolean
isDone
=
(
JobStatus
.
isDone
(
jobInstance
.
getStatus
()))
boolean
isDone
=
(
JobStatus
.
isDone
(
jobInstance
.
getStatus
()))
...
@@ -156,6 +165,8 @@ public class JobRefreshHandler {
...
@@ -156,6 +165,8 @@ public class JobRefreshHandler {
.
toMinutes
()
.
toMinutes
()
>=
1
);
>=
1
);
isDone
=
!
isTransition
&&
isDone
;
if
(!
oldStatus
.
equals
(
jobInstance
.
getStatus
())
||
isDone
||
needSave
)
{
if
(!
oldStatus
.
equals
(
jobInstance
.
getStatus
())
||
isDone
||
needSave
)
{
log
.
debug
(
"Dump JobInfo to database: {}->{}"
,
jobInstance
.
getId
(),
jobInstance
.
getName
());
log
.
debug
(
"Dump JobInfo to database: {}->{}"
,
jobInstance
.
getId
(),
jobInstance
.
getName
());
jobInstanceService
.
updateById
(
jobInstance
);
jobInstanceService
.
updateById
(
jobInstance
);
...
...
dinky-web/src/components/JobTags/StatusTag.tsx
View file @
c76087de
...
@@ -79,8 +79,8 @@ const StatusTag = (props: StatusTagProps) => {
...
@@ -79,8 +79,8 @@ const StatusTag = (props: StatusTagProps) => {
};
};
case
JOB_STATUS
.
RECONNECTING
:
case
JOB_STATUS
.
RECONNECTING
:
return
{
return
{
icon
:
<
ClockCircleOutlined
/>,
icon
:
<
SyncOutlined
spin
/>,
color
:
'
default
'
,
color
:
'
warning
'
,
text
:
'RECONNECTING'
text
:
'RECONNECTING'
};
};
case
JOB_STATUS
.
UNKNOWN
:
case
JOB_STATUS
.
UNKNOWN
:
...
...
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