-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Avoid process crash when elasticsearch response is nil #1467
Avoid process crash when elasticsearch response is nil #1467
Conversation
Add nil pointer check in elasticsearch bulkprocessor's after callback, defined inside pkg/es/config/config.go. In some rare cases, elasticsearch request will return error with nil response, and then nil response will be passed into after callback, and using of nil pointer will cause process crash. Signed-off-by: Li Zhaoxing <lizhaoxing@4paradigm.com>
da31b83
to
3d131c9
Compare
Codecov Report
@@ Coverage Diff @@
## master #1467 +/- ##
=======================================
Coverage 99.82% 99.82%
=======================================
Files 173 173
Lines 8179 8179
=======================================
Hits 8165 8165
Misses 7 7
Partials 7 7 Continue to review full report at Codecov.
|
pkg/es/config/config.go
Outdated
var respval interface{} | ||
if response == nil { | ||
failed = 0 | ||
respval = "nil" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this logged by default as nil when it's nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes , it will be logged as null by default; I will remove unneeded action
Signed-off-by: Li Zhaoxing <lizhaoxing@4paradigm.com>
* Avoid process crash when elasticsearch response is nil Add nil pointer check in elasticsearch bulkprocessor's after callback, defined inside pkg/es/config/config.go. In some rare cases, elasticsearch request will return error with nil response, and then nil response will be passed into after callback, and using of nil pointer will cause process crash. Signed-off-by: Li Zhaoxing <lizhaoxing@4paradigm.com> * Remove unnecessary wrap arround nil pointer in log Signed-off-by: Li Zhaoxing <lizhaoxing@4paradigm.com>
* Avoid process crash when elasticsearch response is nil Add nil pointer check in elasticsearch bulkprocessor's after callback, defined inside pkg/es/config/config.go. In some rare cases, elasticsearch request will return error with nil response, and then nil response will be passed into after callback, and using of nil pointer will cause process crash. Signed-off-by: Li Zhaoxing <lizhaoxing@4paradigm.com> * Remove unnecessary wrap arround nil pointer in log Signed-off-by: Li Zhaoxing <lizhaoxing@4paradigm.com> Signed-off-by: stefan vassilev <stefanvassilev1@gmail.com>
Add nil pointer check in elasticsearch bulkprocessor's
after callback, defined inside pkg/es/config/config.go.
In some rare cases, elasticsearch request will return
error with nil response, and then nil response will
be passed into after callback, and using of nil pointer
will cause process crash.
Signed-off-by: YEXINGZHE54 429567185@qq.com
Which problem is this PR solving?
Short description of the changes