Skip to content

Conversation

@ansssu
Copy link
Contributor

@ansssu ansssu commented Mar 6, 2023

Propagate errors on items. Fix #179

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@cla-checker-service
Copy link

cla-checker-service bot commented Mar 6, 2023

💚 CLA has been signed

@TCheruy
Copy link

TCheruy commented Aug 6, 2025

@Anaethelion (as last main contributor) would you mind taking a look at this PR when you get a chance? #179 has been going on for a long time and prevents from using the bulk indexer in many production use-cases where visibility into failed writes is needed.

* makes code DRYer
* fixes bug where `res.IsError()` resulted in BulkIndexerItem.OnError receiving a nil `err`
@prodsecmachine
Copy link

prodsecmachine commented Nov 13, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Licenses 0 0 0 0 0 issues
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@MattDevy
Copy link
Contributor

Hi all, I've added some tests to cover the new behaviour, with a slight refactor to make the code more DRY and a minor bug fix. This will be sorted soon, thank you for your patience and for your contribution!

@MattDevy MattDevy requested a review from Anaethelion November 13, 2025 13:42
@MattDevy MattDevy added the Category: Bug Something isn't working label Nov 13, 2025
@MattDevy MattDevy changed the title Notify items if an error occurs in bulk indexer fix: Notify items if an error occurs in bulk indexer Nov 20, 2025
@MattDevy MattDevy merged commit 6ea4a8a into elastic:main Nov 25, 2025
19 checks passed
elastic-vault-github-plugin-prod bot pushed a commit that referenced this pull request Nov 25, 2025
* notify items if an error occurs in bulk indexer

* fix message error on line 577

* test: OnFailure is called per item

* refactor: use a method to handle errors

* makes code DRYer
* fixes bug where `res.IsError()` resulted in BulkIndexerItem.OnError receiving a nil `err`

---------

Co-authored-by: Matt Devy <[email protected]>
(cherry picked from commit 6ea4a8a)
elastic-vault-github-plugin-prod bot pushed a commit that referenced this pull request Nov 25, 2025
* notify items if an error occurs in bulk indexer

* fix message error on line 577

* test: OnFailure is called per item

* refactor: use a method to handle errors

* makes code DRYer
* fixes bug where `res.IsError()` resulted in BulkIndexerItem.OnError receiving a nil `err`

---------

Co-authored-by: Matt Devy <[email protected]>
(cherry picked from commit 6ea4a8a)
elastic-vault-github-plugin-prod bot pushed a commit that referenced this pull request Nov 25, 2025
* notify items if an error occurs in bulk indexer

* fix message error on line 577

* test: OnFailure is called per item

* refactor: use a method to handle errors

* makes code DRYer
* fixes bug where `res.IsError()` resulted in BulkIndexerItem.OnError receiving a nil `err`

---------

Co-authored-by: Matt Devy <[email protected]>
(cherry picked from commit 6ea4a8a)
MattDevy added a commit that referenced this pull request Nov 25, 2025
* notify items if an error occurs in bulk indexer

* fix message error on line 577

* test: OnFailure is called per item

* refactor: use a method to handle errors

* makes code DRYer
* fixes bug where `res.IsError()` resulted in BulkIndexerItem.OnError receiving a nil `err`

---------

Co-authored-by: Matt Devy <[email protected]>
(cherry picked from commit 6ea4a8a)
MattDevy added a commit that referenced this pull request Nov 25, 2025
* notify items if an error occurs in bulk indexer

* fix message error on line 577

* test: OnFailure is called per item

* refactor: use a method to handle errors

* makes code DRYer
* fixes bug where `res.IsError()` resulted in BulkIndexerItem.OnError receiving a nil `err`

---------

Co-authored-by: Matt Devy <[email protected]>
(cherry picked from commit 6ea4a8a)
MattDevy added a commit that referenced this pull request Nov 25, 2025
* notify items if an error occurs in bulk indexer

* fix message error on line 577

* test: OnFailure is called per item

* refactor: use a method to handle errors

* makes code DRYer
* fixes bug where `res.IsError()` resulted in BulkIndexerItem.OnError receiving a nil `err`

---------

Co-authored-by: Matt Devy <[email protected]>
(cherry picked from commit 6ea4a8a)
MattDevy added a commit that referenced this pull request Nov 25, 2025
* notify items if an error occurs in bulk indexer

* fix message error on line 577

* test: OnFailure is called per item

* refactor: use a method to handle errors

* makes code DRYer
* fixes bug where `res.IsError()` resulted in BulkIndexerItem.OnError receiving a nil `err`

---------

Co-authored-by: Matt Devy <[email protected]>
(cherry picked from commit 6ea4a8a)
MattDevy added a commit that referenced this pull request Nov 25, 2025
fix: Notify items if an error occurs in bulk indexer (#615)

* notify items if an error occurs in bulk indexer

* fix message error on line 577

* test: OnFailure is called per item

* refactor: use a method to handle errors

* makes code DRYer
* fixes bug where `res.IsError()` resulted in BulkIndexerItem.OnError receiving a nil `err`

---------


(cherry picked from commit 6ea4a8a)

Co-authored-by: ansssu <[email protected]>
Co-authored-by: Matt Devy <[email protected]>
MattDevy added a commit that referenced this pull request Nov 25, 2025
fix: Notify items if an error occurs in bulk indexer (#615)

* notify items if an error occurs in bulk indexer

* fix message error on line 577

* test: OnFailure is called per item

* refactor: use a method to handle errors

* makes code DRYer
* fixes bug where `res.IsError()` resulted in BulkIndexerItem.OnError receiving a nil `err`

---------


(cherry picked from commit 6ea4a8a)

Co-authored-by: ansssu <[email protected]>
Co-authored-by: Matt Devy <[email protected]>
MattDevy added a commit that referenced this pull request Nov 25, 2025
fix: Notify items if an error occurs in bulk indexer (#615)

* notify items if an error occurs in bulk indexer

* fix message error on line 577

* test: OnFailure is called per item

* refactor: use a method to handle errors

* makes code DRYer
* fixes bug where `res.IsError()` resulted in BulkIndexerItem.OnError receiving a nil `err`

---------


(cherry picked from commit 6ea4a8a)

Co-authored-by: ansssu <[email protected]>
Co-authored-by: Matt Devy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BulkIndexer do not provide info to BulkIndexerItem on global worker.flush error

5 participants