{"record":{"id":"0a91ba40d736ef30","repo":"apache/dolphinscheduler","slug":"track-dinkytask-failed","errorCode":null,"errorMessage":"Track dinkyTask failed:","messagePattern":"Track dinkyTask failed:","errorType":"exception","errorClass":"TaskException","httpStatus":null,"severity":"warning","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-dinky/src/main/java/org/apache/dolphinscheduler/plugin/task/dinky/DinkyTask.java","lineNumber":222,"sourceCode":"                        finishFlag = true;\n                        break;\n                    case DinkyTaskConstants.STATUS_FAILED:\n                    case DinkyTaskConstants.STATUS_CANCELED:\n                    case DinkyTaskConstants.STATUS_UNKNOWN:\n                        errorHandle(\n                                jobInstanceInfoResult.get(apiResultDatasKey).get(DinkyTaskConstants.API_RESULT_ERROR)\n                                        .asText());\n                        finishFlag = true;\n                        break;\n                    default:\n                        Thread.sleep(DinkyTaskConstants.SLEEP_MILLIS);\n                }\n            }\n        } catch (InterruptedException ex) {\n            Thread.currentThread().interrupt();\n            log.error(DinkyTaskConstants.TRACK_FAILED_MSG, ex);\n            setExitStatusCode(EXIT_CODE_FAILURE);\n            throw new TaskException(DinkyTaskConstants.TRACK_FAILED_MSG, ex);\n        }\n    }\n\n    public void trackApplicationStatusV1() throws TaskException {\n        try {\n\n            String address = this.dinkyParameters.getAddress();\n            String taskId = this.dinkyParameters.getTaskId();\n            if (status && jobInstanceId == null) {\n                // Use address-taskId as app id\n                setAppIds(String.format(DinkyTaskConstants.APPIDS_FORMAT, address, taskId));\n                setExitStatusCode(mapStatusToExitCode(true));\n                log.info(\"Dinky common sql task finished.\");\n                return;\n            }\n            String apiResultDataKey = DinkyTaskConstants.API_RESULT_DATA;\n            boolean finishFlag = false;\n            while (!finishFlag) {","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-dinky/src/main/java/org/apache/dolphinscheduler/plugin/task/dinky/DinkyTask.java#L204-L240","documentation":"DinkyTask.trackApplicationStatusV0() polls the Dinky API for job status until completion. If the polling loop is interrupted (InterruptedException), the thread is re-interrupted, exit status is set to failure, and a TaskException with TRACK_FAILED_MSG ('Track dinkyTask failed:') is thrown. It means status tracking was aborted, not that the Dinky job itself failed.","triggerScenarios":"InterruptedException during the V0 status polling loop — typically the task being killed/cancelled from the UI or a worker shutdown while sleeping between polls.","commonSituations":"User stops the workflow instance while a Dinky job is still running; worker graceful shutdown; task timeout cancellation interrupting the tracking thread.","solutions":["This is usually expected when the task is cancelled — verify whether the interruption came from an intentional kill.","If unexpected, check worker logs for shutdown or kill events at that timestamp.","Rerun the task; consider increasing task timeout so long Dinky jobs are not auto-cancelled.","Ensure stop/kill handlers in your deployment do not interrupt worker threads prematurely."],"exampleFix":"// before: task timeout too short for long Dinky job\ntimeout=60\n// after\ntimeout=3600","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    task.trackApplicationStatus();\n} catch (TaskException e) {\n    if (Thread.currentThread().isInterrupted()) {\n        log.info(\"Tracking interrupted by cancellation — expected\");\n    }\n}","preventionTips":["Set task timeouts longer than the expected Dinky job duration.","Avoid stopping workflow instances unnecessarily; stop the Dinky job in Dinky instead.","Schedule maintenance restarts outside long-running Dinky jobs."],"tags":["dinky","interrupted","task-tracking"],"backgroundTag":"request-timeout","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}