-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fixes #1255: Introduce an activation lock to protect the raw connecti… #1262
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1262 +/- ##
==========================================
- Coverage 78.95% 78.41% -0.55%
==========================================
Files 244 246 +2
Lines 63056 63568 +512
Branches 5931 5874 -57
==========================================
+ Hits 49784 49844 +60
- Misses 10616 11070 +454
+ Partials 2656 2654 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -1410,10 +1418,12 @@ static void CORE_activate(void *context, qdr_connection_t *core_conn) | |||
|
|||
case TL_CONNECTION: | |||
conn = (tcplite_connection_t*) common; | |||
sys_mutex_lock(&conn->activation_lock); | |||
if (IS_ATOMIC_FLAG_SET(&conn->raw_opened)) { | |||
SET_ATOMIC_FLAG(&conn->core_activation); |
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.
With this lock in place, are there any atomic flags we can convert to bools?
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.
It looks like the conn->raw_opened
flag can be knocked down to boolean. The conn->core_activation
flag needs to remain atomic.
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 have added code to this PR that set the conn->raw_opened
to boolean. Please take a look.
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.
Something is super wrong with the change I made. CI is blowing up. I am looking into it.
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.
After further analysis, the atomic flags that are used inside the new activation lock are also sometimes used outside the activation lock, so my conclusion is that those flags cannot be converted from atomic to boolean
f763814
to
25c4c05
Compare
…e raw connection from being activated when it is being torn down
…c/cutthrough_utils.c
25c4c05
to
9607aa5
Compare
…on from being activated when it is being torn down