Skip to content

Commit

Permalink
Fix error handling bug in mongodb processor
Browse files Browse the repository at this point in the history
This regression was introduced in 64eb72.
  • Loading branch information
mihaitodor committed Nov 14, 2022
1 parent f36daad commit bd4ba39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ All notable changes to this project will be documented in this file.
- Field `client_session_keep_alive` added to the `snowflake_put` output.
- Bloblang now supports metadata access via `@foo` syntax, which also supports arbitrary values.

### Fixed

- Fixed a regression bug in the `mongodb` processor where message errors were not set any more. This issue was introduced in v4.7.0 (64eb72).

## 4.10.0 - 2022-10-26

### Added
Expand Down
9 changes: 7 additions & 2 deletions internal/impl/mongodb/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,13 @@ func NewProcessor(conf processor.Config, mgr bundle.NewManagement) (processor.V2
// resulting messages or a response to be sent back to the message source.
func (m *Processor) ProcessBatch(ctx context.Context, spans []*tracing.Span, batch message.Batch) ([]message.Batch, error) {
writeModelsMap := map[*mongo.Collection][]mongo.WriteModel{}
_ = batch.Iter(func(i int, p *message.Part) error {
var err error
_ = batch.Iter(func(i int, p *message.Part) (err error) {
defer func() {
if err != nil {
p.ErrorSet(err)
}
}()

var filterVal, documentVal *message.Part
var upsertVal, filterValWanted, documentValWanted bool

Expand Down

0 comments on commit bd4ba39

Please sign in to comment.