# Bulk Index task hangs

**URL:** <https://discuss.elastic.co/t/bulk-index-task-hangs/143794>\
**Category:** Elasticsearch\
**Created:** [August 10, 2018, 4:14am UTC](https://discuss.elastic.co/t/bulk-index-task-hangs/143794 "2018-08-10T04:14:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel.b.sario](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@daniel.b.sario](https://discuss.elastic.co/u/daniel.b.sario)\
**Post date:** [August 10, 2018, 4:14am UTC](https://discuss.elastic.co/t/bulk-index-task-hangs/143794/1 "2018-08-10T04:14:22Z")

</div>

I did a bulk index task using java api. After a few successful bulk index requests, suddenly my indexer hangs. I checked the the status of index tasks using the task api of elasticsearch and I found that there are tasks still running and was going for 30+ minutes and its status is 'waiting\_on\_primary'.

What should I do to fix this?, Do I need to change something from the elasticsearch.yml?. Please HELP!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 10, 2018, 5:54am UTC](https://discuss.elastic.co/t/bulk-index-task-hangs/143794/2 "2018-08-10T05:54:26Z")

</div>

Anything in logs?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 10, 2018, 6:19am UTC](https://discuss.elastic.co/t/bulk-index-task-hangs/143794/3 "2018-08-10T06:19:22Z")

</div>

What is the size of your documents? How large are your bulk requests? How many parallel indexing threads/processes do you have? What is the specification of the cluster?

---

<div class="post-metadata">

**Author:** ![daniel.b.sario](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@daniel.b.sario](https://discuss.elastic.co/u/daniel.b.sario)\
**Post date:** [August 10, 2018, 6:53am UTC](https://discuss.elastic.co/t/bulk-index-task-hangs/143794/4 "2018-08-10T06:53:07Z")

</div>

@Christian_Dahlqvist I have the below configuration for BulkProcessor

- Bulk Size = 5MB
- Flush Interval = 30 seconds
- Concurrent Request = 2

I only have one node, 8 shards. the ES version im using is 6.2.3

---

<div class="post-metadata">

**Author:** ![daniel.b.sario](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@daniel.b.sario](https://discuss.elastic.co/u/daniel.b.sario)\
**Post date:** [August 10, 2018, 6:58am UTC](https://discuss.elastic.co/t/bulk-index-task-hangs/143794/5 "2018-08-10T06:58:52Z")

</div>

@dadoonet There were nothing on logs except for those documents that failed in indexing. I cant cancel the task as is tagged as not cancel-able.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 7, 2018, 6:58am UTC](https://discuss.elastic.co/t/bulk-index-task-hangs/143794/6 "2018-09-07T06:58:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
