question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BulkAll vs. Exceptions

See original GitHub issue

Using NEST 5.2 with this index code;


 var waitHandle2 = new CountdownEvent(1);

            var bulkAll = elasticClient.BulkAll(docs, b => b
                .MaxDegreeOfParallelism(8)
                .BackOffTime(TimeSpan.FromSeconds(10))
                .BackOffRetries(2)
                .Size(1000)
                .RefreshOnCompleted() 
                .Index(indexName)
            );

            bulkAll.Subscribe(new BulkAllObserver(
                onNext: (b) => { Console.Write("."); },
                onError: (e) => { throw e; },
                onCompleted: () => waitHandle2.Signal()
            ));

            waitHandle2.Wait();

            return;

If an exception is thrown the onError is hit, but the code never reaches the return statement

Please advise

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Mpdreamzcommented, Mar 14, 2017

Instead of calling .Subscribe() you can now also call .Wait(TimeSpan, Action onNext) which will block and throw exceptions more naturally if blocking is the desired behavior.

1reaction
rosrosroscommented, Mar 1, 2017

Thanks mate - and keep up the good work!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ElasticSearch Nest BulkAll halted after receiving failures ...
This means that the BulkAll observable is unable to index one or more documents that have failed for a reason that cannot be...
Read more >
Error: 'BulkAll halted after receiving failures that can not be ...
I am currently using a foreach to index through a pipeline using the nest client. This is slow and highly inefficient. But works....
Read more >
Indexing documents | Elasticsearch .NET Clients [7.16]
An observer such as BulkAllObserver should not throw exceptions from its interface implementations, such as OnNext and OnError . Any exceptions thrown should...
Read more >
More advanced features of the high-level .NET client
The BulkAll helper frees you from handling retry, chunking or back off request functionality. It automatically retries if the request fails, backs off...
Read more >
Invalid NEST response built from a successful (200) low ...
I saw the following error message in the logs: BulkAll halted after receiving failures that can not be retried from _bulk at Nest....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found