Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java API: BulkProcessor does not call afterBulk when bulk throws eg NoNodeAvailableException #5038

Closed
anrask opened this issue Feb 6, 2014 · 8 comments

Comments

@anrask
Copy link

anrask commented Feb 6, 2014

When using a BulkProcessor with setting concurrentRequests > 0 and an exception occurs on row 283 (client.bulk(...)) other than InterruptedException then it is not caught and subsequently the afterBulk function is never called.

It is reproducible by running:

  • a transport client without an elasticsearch to connect to
  • with the BulkProcessor configured with concurrentRequests > 0
  • sending in enough documents so that the bulk is sent

This problem leads to that you only get exception for 1 of the documents in the bulk and there is no way to know that the other documents also failed.

@karlney
Copy link

karlney commented Feb 6, 2014

FYI this bug is related to #4153, #4155 and #4158

@javanna javanna self-assigned this Feb 7, 2014
@vorce
Copy link

vorce commented Mar 31, 2014

Any progress on this yet?

@btiernay
Copy link

I'm trying to implement a workaround for #6314 and this is required. Any update here for a fix?

@telax1985
Copy link

Hello,

I'm seeing an issue with the bulk request API where I am sending many bulk requests simultaneously.

When my index reaches a certain size and the amount of memory assigned to each shard is increased (i.e. increasing from 56Mb allocated to 128Mb allocated) the pending bulk requests fail to respond (i.e. no call to 'onResponse' or 'onFailure' in the BulkRequest ActionListener) effectively locking my application from sending any additional requests as the semaphore flags acquired before calling 'execute' are never released.

Could this issue relate to a problem that I am seeing with the bulk request API?

Thanks,
Andrew

@javanna
Copy link
Member

javanna commented Jun 13, 2014

Hi @awnixon ,
if you mean the semaphore within BulkProcessor, that's now released in a finally block. Which version of elasticsearch are you using though? This reminds me of #4153, it might be your problem if you're using an old version of elasticsearch,

@telax1985
Copy link

Hi @javanna,

Within my own client application I manage the number of bulk requests which may be sent using a semaphore flag which is acquired before calling execute and released once a response is received.
The issue you referenced does sound similar to my own, however I am using the 2.0.0-SNAPSHOT version (as of the 9th of June).

Also, I do not see any exceptions coming from the elasticsearch node. Simply the statement that the amount of memory allocated to each shard is to be increased at which point the number of pending requests in my client application steadily increases without any response from the server. I am still able to execute curl -XGet requests (i.e. elastisearch cluster state is reported as green on request).

I hope that helps.

All the best,
Andrew

@javanna
Copy link
Member

javanna commented Jun 13, 2014

Then the problem can't be in the BulkProcessor as you are not using it. I'd suggest to switch to it though. There might be an issue in your client code that handles the semaphore?

javanna added a commit to javanna/elasticsearch that referenced this issue Jun 13, 2014
Also strenghtened BulkProcessorTests by adding randomizations to existing tests and new tests for concurrent requests and expcetions

Closes elastic#5038
javanna added a commit that referenced this issue Jun 13, 2014
… beforeBulk

Moved BulkProcessor tests from BulkTests to newly added BulkProcessorTests class.
Strenghtened BulkProcessorTests by adding randomizations to existing tests and new tests for concurrent requests and expcetions.
Also made sure that afterBulk is called only once per request if concurrentRequests==0.

Closes #5038
@telax1985
Copy link

Thanks for the suggestion. I've switched to the BulkProcessor and found the
situation to be the same where I set the level of concurrency to > 1.
I believe that I have found the root cause of my issue however. Whilst
using concurrent concurrent bulk requests I'm reaching (or exceeding) the
specified "indices.memory.max_index_buffer_size" (which I've set to 256Mb
during testing). When I increase the "indices.memory.max_index_buffer_size"
value my issue no longer occurs. Would you expect elasticsearch to handle
this situation by rejecting some/all pending requests or should it be
returning to the current set of pending requests once the
"index_buffer_size" for each shard has been updated?

On 13 June 2014 15:59, Luca Cavanna notifications@github.com wrote:

Then the problem can't be in the BulkProcessor as you are not using it.
I'd suggest to switch to it though. There might be an issue in your client
code that handles the semaphore?


Reply to this email directly or view it on GitHub
#5038 (comment)
.

@spinscale spinscale changed the title BulkProcessor does not call afterBulk when sending bulk fails with for example NoNodeAvailableException Bulk API: BulkProcessor does not call afterBulk when sending bulk fails with for example NoNodeAvailableException Jun 18, 2014
@clintongormley clintongormley changed the title Bulk API: BulkProcessor does not call afterBulk when sending bulk fails with for example NoNodeAvailableException Bulk API: BulkProcessor does not call afterBulk when bulk throws eg NoNodeAvailableException Jul 16, 2014
@clintongormley clintongormley changed the title Bulk API: BulkProcessor does not call afterBulk when bulk throws eg NoNodeAvailableException Java API: BulkProcessor does not call afterBulk when bulk throws eg NoNodeAvailableException Sep 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants