Skip to content

Commit

Permalink
[filebeat][httpjson]- improved error handling during pagination with …
Browse files Browse the repository at this point in the history
…chaining & split processor (#34127)

* added a safety check to avoid unnecessary panics

* updated asciidoc

* updated asciidoc
  • Loading branch information
ShourieG committed Dec 28, 2022
1 parent 2c21577 commit 4e70b69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]


*Filebeat*
- [httpsjon] Improved error handling during pagination with chaining & split processor {pull}34127[34127]
- [Azure blob storage] Added support for more mime types & introduced offset tracking via cursor state. {pull}33981[33981]
- Fix EOF on single line not producing any event. {issue}30436[30436] {pull}33568[33568]
- Fix handling of error in states in direct aws-s3 listing input {issue}33513[33513] {pull}33722[33722]
Expand Down
7 changes: 6 additions & 1 deletion x-pack/filebeat/input/httpjson/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,12 @@ func (r *requester) processChainPaginationEvents(stdCtx context.Context, trCtx *
n += processAndPublishEvents(chainTrCtx, events, publisher, i < len(r.requestFactories), r.log)
}

defer httpResp.Body.Close()
defer func() {
if httpResp != nil && httpResp.Body != nil {
httpResp.Body.Close()
}
}()

return n, nil
}

Expand Down

0 comments on commit 4e70b69

Please sign in to comment.