-
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 session lock of OtlpHttpClient
#1760
Conversation
Signed-off-by: owent <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1760 +/- ##
==========================================
+ Coverage 85.77% 85.79% +0.02%
==========================================
Files 171 171
Lines 5220 5220
==========================================
+ Hits 4477 4478 +1
+ Misses 743 742 -1
|
The failed job seems not a problem of this PR. |
session_data.event_handle; | ||
{ | ||
std::lock_guard<std::recursive_mutex> guard{session_manager_lock_}; | ||
static_cast<ResponseHandler *>(handle.get())->Bind(this, *session); |
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 statement needs to be under lock ?
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.
No, it's not necessary, but I think ResponseHandler::Bind
and inserting element into running_sessions_
below should work together logically.
|
||
HttpSessionData &store_session_data = running_sessions_[key]; | ||
store_session_data = std::move(session_data); | ||
HttpSessionData &store_session_data = running_sessions_[session.get()]; |
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.
Just curious , why can't we just use session_data.session.get()
instead of session.get()
for indexing here?
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 believe it's same here.
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.
LGTM. Thanks for the fix.
Signed-off-by: owent [email protected]
Fixes #1759
Changes
OtlpHttpClient
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes