Repository navigation
[Fix-18677][master] Null-safe taskExecuteType in task finish logging and default it to BATCH on save - #18678
Open
wank125 wants to merge 1 commit into
Open
[Fix-18677][master] Null-safe taskExecuteType in task finish logging and default it to BATCH on save#18678wank125 wants to merge 1 commit into
wank125 wants to merge 1 commit into
Conversation
…and default it to BATCH on save Task definitions created via the workflow export/import round trip can carry taskExecuteType=null (the exported JSON has no taskExecuteType and the import path does not default it; the column has no default value either). When such a task finishes, WorkflowInstanceUtils#logTaskInstanceInDetail throws an NPE on the taskFinish path, the state event is retried a few times and then dropped, leaving the task instance stuck in RUNNING forever, the workflow instance never completing, and the master re-dispatching the shell repeatedly. - logTaskInstanceInDetail renders null taskExecuteType as N/A instead of throwing, so a logging helper can no longer crash the task finish chain - ProcessServiceImpl#saveTaskDefine defaults a missing taskExecuteType to BATCH, so task definitions saved from import (and any other caller) never persist null Verified on a 3.2.2 deployment: 48 imported task definitions with task_execute_type NULL deterministically reproduced the stuck state; fixing the data restored normal completion immediately.
wank125
requested review from
SbloodyS,
caishunfeng and
ruanwenjun
as code owners
October 7, 2026 23:00
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was this PR generated or assisted by AI?
YES — the fix, the regression test and this description were drafted with AI assistance (Claude-based coding agent). The bug was discovered while operating a production DolphinScheduler 3.2.2 deployment; the change was reviewed locally by the submitter (the service module compiles and passes spotless locally; the master module could not be built in the submitter's network environment due to an unrelated dependency range resolution issue, so CI validation is relied upon for it).
Purpose of the pull request
Fixes #18677
Task definitions created via the export → import round trip can carry
taskExecuteType = null(exported JSON has no such field, import does not default it, and the DB column has no default value). When such a task finishes:A pure logging helper thus has the power to crash the task finish chain. Verified on a production 3.2.2 deployment: 48 imported task definitions with
task_execute_type NULLreproduced the stuck state deterministically; fixing the data restored normal completion immediately.Brief change log
WorkflowInstanceUtils#logTaskInstanceInDetail: render nulltaskExecuteTypeasN/Ainstead of throwing — a logging helper must not be able to take down the task finish event chainProcessServiceImpl#saveTaskDefine: default a missingtaskExecuteTypetoBATCH, so task definitions saved from workflow import (and any other caller) never persist nullVerify this pull request
This change added tests and can be verified as follows:
testLogTaskInstanceInDetailWithNullTaskExecuteTypetoWorkflowInstanceUtilsTest: invoking the log helper with a nulltaskExecuteTypeno longer throws and rendersN/A