-
Notifications
You must be signed in to change notification settings - Fork 849
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
[REFAX] Refactored function calls at close socket for preparing a change #2639
base: master
Are you sure you want to change the base?
Conversation
Extracted from #1829. |
Careful. This last fix has caused tests to crash. |
Now the refax should be ok, but all attempts to provide a reliable closing a socket have failed, so this refax is useless. |
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 am concerned with this function because it provides not much hints of what it does internally.
It notably comes from the overall mess with socket lifetime management.
There is m_ClosedSockets
for sockets to be closed and m_Sockets for active sockets.
A socket can sometimes be present in both lists for a short time.
swipeSocket_LOCKED(i->first, s, SWIPE_LATER)
with SWIPE_LATER
is only used in checkBrokenSockets(..)
. All other places use SWIPE_NOW
. Does it make sense to have a function that does both?
newConnection error, srt_close, removeSocket
-> SWIPE_NOW
.
checkBrokenSockets(..)
, srt_cleanup -> SWIPE_LATER
.
The SWIPE_NOW and SWIPE_LATER differ only with that when SWIPE_LATER is used, then the call will be followed by a loop that will delete all sockets that were collected in the temporary list. So the socket being worked about at this call need not be swiped at this moment. |
Co-authored-by: Maxim Sharabayko <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2639 +/- ##
==========================================
- Coverage 66.50% 66.22% -0.29%
==========================================
Files 99 99
Lines 19820 19848 +28
==========================================
- Hits 13182 13144 -38
- Misses 6638 6704 +66 ☔ View full report in Codecov by Sentry. |
No description provided.