dosubot[bot] commented on issue #3059: URL: https://github.com/apache/hugegraph/issues/3059#issuecomment-4679851161
<!-- Answer --> The reason restarting doesn't help is that **HugeGraph persists running/pending tasks as `~task` vertices in backend storage and automatically restores them on server startup** [[1]](https://github.com/apache/hugegraph/blob/9126c80e414c073b60fc074361b211cfb409e0eb/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/StandardHugeGraph.java). So your problematic task keeps getting re-queued every time the server comes back up. **To break out of this cycle, use the force-delete API:** ```bash DELETE http://{IP}:{PORT}/graphs/{GRAPH_NAME}/tasks/{TASK_ID}?force=true ``` This removes the task from both memory and backend storage, preventing it from being restored on the next restart [[2]](https://github.com/apache/hugegraph/blob/9126c80e414c073b60fc074361b211cfb409e0eb/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/job/TaskAPI.java) [[3]](https://github.com/apache/hugegraph/issues/3057#issuecomment-4656832523). **If all APIs are hanging**, try this sequence: 1. Restart the server 2. **Immediately** issue the force-delete request before the restored task consumes all resources again 3. If you don't know the task ID, try `GET /graphs/{graph}/tasks?status=RUNNING` quickly after restart **If that still doesn't work** (because the task re-queues too fast), you could try: - Temporarily reduce the Gremlin task thread pool or add a short startup delay to give yourself a window - As a last resort, if you have direct access to the RocksDB data directory, you could delete and recreate the problematic graph entirely using `DELETE /graphs/{graph}/clear` right after restart **To prevent this in the future:** - Set `task.result_size_limit` to a smaller value to prevent tasks from accumulating massive results - For complex analytical queries, consider using the OLAP/algorithm APIs rather than raw Gremlin tasks, or break the query into smaller batches - Note that HugeGraph only has 4 threads dedicated to Gremlin task execution [[4]](https://github.com/apache/hugegraph/blob/9126c80e414c073b60fc074361b211cfb409e0eb/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskManager.java), so a single resource-intensive task can significantly impact throughput <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fhugegraph).* --- Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fhugegraph). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fhugegraph&message_id=814ded56-ebdb-48d4-ac3b-6507af5bcf36) [](https://github.dosu.com/apache/hugegraph?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fhugegraph) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fhugegraph) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
