dolphinscheduler
dolphinscheduler copied to clipboard
[Fix-#11669][Workflow Instance Page] Fix the duration and EndTime in Workflow Instance page.
Purpose of the pull request
fix #11669
Brief change log
- Set the update strategy of field ProcessInstance#endTime to @TableField(updateStrategy = FieldStrategy.IGNORED). Because now setEndTime(null) cannot take affect.
- When processInstance is running or serial wait, the val of workflow instance duration should be null.
- Add a condition in DateUtils.format2Duration, make sure that startTime must before endTime.
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
re-run a workflow instance, then check the endTime and duration.
(or)
If your pull request contain incompatible change, you should also add it to docs/docs/en/guide/upgrede/incompatible.md
Hi @DarkAssassinator I think you can use the restartTime field in processInstance to calculate the duration when restart.
WDYT?
Hi @DarkAssassinator I think you can use the
restartTimefield in processInstance to calculate the duration when restart. WDYT?
Hi @caishunfeng happy mid-Autumn Festival. The following change can make sure the duration value.

But the UI page still will show the last EndTime, but re-run still running, not finish. So i think that we need to make sure that setEndTime(null) can take affect
But the UI page still will show the last EndTime, but re-run still running, not finish. So i think that we need to make sure that setEndTime(null) can take affect
OK, but can we replace the field annotation with udpateWrapper or the global config FieldStrategy? Because if you just configure a field separately, it may be a hidden logic. WDYT? cc @ruanwenjun
But the UI page still will show the last EndTime, but re-run still running, not finish. So i think that we need to make sure that setEndTime(null) can take affect
OK, but can we replace the field annotation with udpateWrapper or the global config FieldStrategy? Because if you just configure a field separately, it may be a hidden logic. WDYT? cc @ruanwenjun
i think that the global config FieldStratrgy should be better, but we need review all MybatisPlus updateById to make sure that the FiledStrategy.IGNORE can match all scenes
But the UI page still will show the last EndTime, but re-run still running, not finish. So i think that we need to make sure that setEndTime(null) can take affect
OK, but can we replace the field annotation with udpateWrapper or the global config FieldStrategy? Because if you just configure a field separately, it may be a hidden logic. WDYT? cc @ruanwenjun
i think that the global config FieldStratrgy should be better, but we need review all MybatisPlus updateById to make sure that the FiledStrategy.IGNORE can match all scenes
It's not a good idea to use the strategy from MybatisPlus, we may use another ORM in the future.
But the UI page still will show the last EndTime, but re-run still running, not finish. So i think that we need to make sure that setEndTime(null) can take affect
OK, but can we replace the field annotation with udpateWrapper or the global config FieldStrategy? Because if you just configure a field separately, it may be a hidden logic. WDYT? cc @ruanwenjun
i think that the global config FieldStratrgy should be better, but we need review all MybatisPlus updateById to make sure that the FiledStrategy.IGNORE can match all scenes
It's not a good idea to use the
strategyfrom MybatisPlus, we may use another ORM in the future.
+1 I also think MP is not suitable for enterprise projects
Codecov Report
Merging #11693 (41885c8) into dev (6fc209a) will increase coverage by
0.00%. The diff coverage is60.00%.
@@ Coverage Diff @@
## dev #11693 +/- ##
=========================================
Coverage 39.70% 39.71%
+ Complexity 4193 4191 -2
=========================================
Files 1016 1016
Lines 38049 38057 +8
Branches 4363 4369 +6
=========================================
+ Hits 15109 15114 +5
Misses 21195 21195
- Partials 1745 1748 +3
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...r/api/service/impl/ProcessInstanceServiceImpl.java | 57.37% <50.00%> (-0.34%) |
:arrow_down: |
| ...pache/dolphinscheduler/common/utils/DateUtils.java | 74.39% <100.00%> (+0.31%) |
:arrow_up: |
| ...er/master/dispatch/host/assign/RandomSelector.java | 77.77% <0.00%> (-5.56%) |
:arrow_down: |
| ...r/plugin/task/sqoop/parameter/SqoopParameters.java | 55.12% <0.00%> (-1.29%) |
:arrow_down: |
| ...erver/master/processor/queue/TaskEventService.java | 80.35% <0.00%> (+5.35%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
wrong PR, contain many history records, close it and then will re-open a new PR







