{"record":{"id":"ff0cb7a203a057d7","repo":"apache/dolphinscheduler","slug":"task-group-queue-already-start","errorCode":"TASK_GROUP_QUEUE_ALREADY_START","errorMessage":"TASK_GROUP_QUEUE_ALREADY_START","messagePattern":"TASK_GROUP_QUEUE_ALREADY_START","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"warning","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java","lineNumber":380,"sourceCode":"            putMsg(response, Status.EXECUTE_WORKFLOW_INSTANCE_ERROR);\n        }\n\n        return response;\n    }\n\n    @Override\n    public void forceStartTaskInstance(User loginUser, int queueId) {\n        TaskGroupQueue taskGroupQueue = taskGroupQueueMapper.selectById(queueId);\n        // check workflow instance exist\n        WorkflowInstance workflowInstance =\n                workflowInstanceDao.queryOptionalById(taskGroupQueue.getWorkflowInstanceId())\n                        .orElseThrow(\n                                () -> new ServiceException(Status.WORKFLOW_INSTANCE_NOT_EXIST,\n                                        taskGroupQueue.getWorkflowInstanceId()));\n        projectService.checkHasProjectWritePermissionThrowException(loginUser, workflowInstance.getProjectCode());\n\n        if (taskGroupQueue.getInQueue() == Flag.NO.getCode()) {\n            throw new ServiceException(Status.TASK_GROUP_QUEUE_ALREADY_START);\n        }\n        taskGroupQueue.setForceStart(Flag.YES.getCode());\n        taskGroupQueue.setUpdateTime(new Date());\n        taskGroupQueueMapper.updateById(taskGroupQueue);\n    }\n\n    @Override\n    public void execStreamTaskInstance(User loginUser,\n                                       long projectCode,\n                                       long taskDefinitionCode,\n                                       int taskDefinitionVersion,\n                                       int warningGroupId,\n                                       String workerGroup,\n                                       String tenantCode,\n                                       Long environmentCode,\n                                       Map<String, String> startParams,\n                                       int dryRun) {\n        throw new ServiceException(\"Not supported\");","sourceCodeStart":362,"sourceCodeEnd":398,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java#L362-L398","documentation":"TASK_GROUP_QUEUE_ALREADY_START is thrown by forceStartTaskInstance when the task-group queue entry has inQueue == NO, meaning the task has already acquired a task-group slot and is no longer waiting in queue, so forcing a start is unnecessary and rejected.","triggerScenarios":"Calling forceStartTaskInstance for a taskGroupQueue whose inQueue flag is Flag.NO — the task already left the waiting queue (already started or already granted resources).","commonSituations":"Double-clicking 'force start' in the task group queue UI; automations retrying force-start after the task already began; race conditions where the queue drained between listing and forcing.","solutions":["Do nothing — the task already started; refresh the task group queue list to confirm.","Only call force-start for entries showing inQueue=yes/waiting state.","Make automation idempotent: check inQueue status before forcing and treat this error as success."],"exampleFix":"// before\nqueue.forceStart(queueId); // may fail if already started\n// after\nTaskGroupQueue q = taskGroupQueueMapper.selectById(queueId);\nif (q.getInQueue() == Flag.YES.getCode()) {\n    queue.forceStart(queueId);\n}","handlingStrategy":"validation","validationCode":"if (queue.getInQueue() == Flag.NO.getCode()) { /* skip force-start: already running */ }","typeGuard":"boolean isWaitingInQueue(TaskGroupQueue q) { return q != null && q.getInQueue() == Flag.YES.getCode(); }","tryCatchPattern":"try { forceStartTaskInstance(loginUser, id); } catch (ServiceException e) { if (e.getCode() == Status.TASK_GROUP_QUEUE_ALREADY_START) { /* treat as already-started: idempotent no-op */ } else throw e; }","preventionTips":["Check inQueue status before force-starting.","Make retry loops treat this status as success.","Avoid manual repeated force-start clicks."],"tags":["task-group","queue","idempotency","dolphinscheduler"],"backgroundTag":"invalid-state-transition","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}