Skip to content
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

Closed
wants to merge 4 commits into from
Closed

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Jan 3, 2022

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
  • Unit tests have been added
  • Changes in public API reviewed

@lalitb lalitb requested a review from a team January 3, 2022 18:57
@codecov
Copy link

codecov bot commented Jan 3, 2022

Codecov Report

Merging #1169 (18fe707) into main (49648bd) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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;
Copy link
Contributor

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?

Copy link
Member

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:
Copy link
Member

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]

@github-actions github-actions bot added the Stale label Mar 14, 2022
@lalitb lalitb removed the Stale label Mar 22, 2022
@github-actions github-actions bot added the Stale label May 22, 2022
@github-actions github-actions bot closed this May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants