dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[Bug] [dolphinscheduler-master] fix WorkflowExecuteRunnable's executeTask method return incorrect value

Open ZhongJinHacker opened this issue 11 months ago • 3 comments

Purpose of the pull request

This pull request to fix #15740 , fix the method return incorrect value problem.

please check the issue out for details

Brief change log

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:

(or)

If your pull request contain incompatible change, you should also add it to docs/docs/en/guide/upgrede/incompatible.md

ZhongJinHacker avatar Mar 19 '24 16:03 ZhongJinHacker

Right now, pause task will also use this method to submit, and should return false, this change will influence the whole process. Is there a case to reproduce this bug?

ruanwenjun avatar Mar 20 '24 02:03 ruanwenjun

to executeTask method's logic, I can understand the logic intention. Only executeTask success will return true, and if write the taskInstance to db fail or throw Exception will return false.
But in the follow code: image

it is incorrect. the log ("Submit standby task: {} failed")also can express this. when taskInstance write to db unsuccessfully.processService.submitTask will return false, it let into the code block. and return true . this incorrect boolean value will cause the out layer caller who call executeTask method think the task is executed successfully, but in the fact, the task do not write into database's table

ZhongJinHacker avatar Mar 20 '24 13:03 ZhongJinHacker

image

if taskInstanceDao.submitTaskInstanceToDB do not success, the taskinstance will do not submit to db. and return false.here is correct. But its caller executeTask will return true in its code, it will cause this problem

you can use my unit test to reproduce this bug, or close the db or simulate the db Fault when call submitTask in debug mode

ZhongJinHacker avatar Mar 20 '24 13:03 ZhongJinHacker

This pull request has been automatically marked as stale because it has not had recent activity for 120 days. It will be closed in 7 days if no further activity occurs.

github-actions[bot] avatar Jul 30 '24 00:07 github-actions[bot]

This pull request has been closed because it has not had recent activity. You could reopen it if you try to continue your work, and anyone who are interested in it are encouraged to continue work on this pull request.

github-actions[bot] avatar Aug 07 '24 00:08 github-actions[bot]