-
Notifications
You must be signed in to change notification settings - Fork 438
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
Fix deadlock for ES #1169
Fix deadlock for ES #1169
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1169 +/- ##
=======================================
Coverage 92.37% 92.37%
=======================================
Files 202 202
Lines 7336 7336
=======================================
Hits 6776 6776
Misses 560 560 |
@@ -100,6 +120,9 @@ class ResponseHandler : public http_client::EventHandler | |||
std::condition_variable cv_; | |||
std::mutex mutex_; | |||
|
|||
// Whether notify has been called | |||
bool stop_waiting_ = false; |
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.
Does this need to be atomic as it could be read/set from multiple threads?
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.
I think stop_waiting_
is already protected by mutex_
, there's no need to declare stop_waiting_
as atomic.
switch (state) | ||
{ | ||
case http_client::SessionState::CreateFailed: | ||
case http_client::SessionState::ConnectFailed: |
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.
Would it be possible to add the enumeration values which are not handled?
enumeration value 'CreateFailed' not handled in switch [-Wswitch]
Fixes #1141
Changes
Elastic search exporter also suffers from deadlock issue similar to otlp, fix similar to #1163
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes