{"record":{"id":"0b3c6859dc95e86d","repo":"conductor-oss/conductor","slug":"failed-to-remove-task-s","errorCode":null,"errorMessage":"Failed to remove task: %s","messagePattern":"Failed to remove task: (.+?)","errorType":"exception","errorClass":"TransientException","httpStatus":500,"severity":"error","filePath":"cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraExecutionDAO.java","lineNumber":803,"sourceCode":"                            UUID.fromString(task.getWorkflowInstanceId()),\n                            DEFAULT_SHARD_ID,\n                            task.getTaskId()));\n            batchStatement.add(\n                    updateTotalTasksStatement.bind(\n                            totalTasks - 1,\n                            UUID.fromString(task.getWorkflowInstanceId()),\n                            DEFAULT_SHARD_ID));\n            ResultSet resultSet = session.execute(batchStatement);\n            if (task.getTaskDefinition().isPresent()\n                    && task.getTaskDefinition().get().concurrencyLimit() > 0) {\n                removeTaskFromLimit(task);\n            }\n            return resultSet.wasApplied();\n        } catch (DriverException e) {\n            Monitors.error(CLASS_NAME, \"removeTask\");\n            String errorMsg = String.format(\"Failed to remove task: %s\", task.getTaskId());\n            LOGGER.error(errorMsg, e);\n            throw new TransientException(errorMsg);\n        }\n    }\n\n    protected void removeTaskLookup(TaskModel task) {\n        try {\n            recordCassandraDaoRequests(\n                    \"removeTaskLookup\", task.getTaskType(), task.getWorkflowType());\n            if (task.getTaskDefinition().isPresent()\n                    && task.getTaskDefinition().get().concurrencyLimit() > 0) {\n                removeTaskFromLimit(task);\n            }\n            session.execute(deleteTaskLookupStatement.bind(UUID.fromString(task.getTaskId())));\n        } catch (DriverException e) {\n            Monitors.error(CLASS_NAME, \"removeTaskLookup\");\n            String errorMsg = String.format(\"Failed to remove task lookup: %s\", task.getTaskId());\n            LOGGER.error(errorMsg, e);\n            throw new TransientException(errorMsg);\n        }","sourceCodeStart":785,"sourceCodeEnd":821,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraExecutionDAO.java#L785-L821","documentation":"removeTask wraps DriverException in a TransientException naming the task id. The removal executes a batch (task delete + lookup delete) and optionally removes the task from its concurrency limit; any driver-level failure is retried by the framework RetryTemplate.","triggerScenarios":"The batched task removal fails at the driver level: batch write timeout, node unavailable, consistency not met, or a nested removeTaskFromLimit failure.","commonSituations":"Cluster stress during workflow sweep/scheduling, driver pool exhaustion, RF/consistency mismatch under node loss.","solutions":["Confirm Cassandra health and that the batch write consistency is satisfiable.","Tune DataStax driver batch/timeout and connection pool settings.","Use the built-in retry; if exhausted, examine the logged DriverException cause.","Check for oversized batches if a workflow has very many tasks."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"RetryTemplate retry = RetryTemplate.builder().retryOn(TransientException.class).maxAttempts(3).noBackoff().build();\nreturn retry.execute(ctx -> removeTask(task));","preventionTips":["Avoid oversized task-removal batches for very large workflows.","Tune driver batch warnings/timeout thresholds.","Keep write consistency satisfiable during cluster stress."],"tags":["cassandra","persistence","transient","driver","task","batch","retry","dao"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}