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

[core] Fixed bug: tsbpd might miss m_bClosing flag setting, flag not always properly set. #1709

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

ethouris
Copy link
Collaborator

Fixed:

  • Properly set the flag before calling releaseSync
  • TSBPD: check the flag immediately after re-locking m_RecvLock

Added some sanity checks

@maxsharabayko maxsharabayko added this to the v1.4.3 milestone Dec 22, 2020
@maxsharabayko maxsharabayko added [core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior labels Dec 22, 2020
@maxsharabayko maxsharabayko modified the milestones: v1.4.3, v1.4.4 Apr 13, 2021
@maxsharabayko maxsharabayko modified the milestones: v1.4.4, Backlog Aug 17, 2021
srtcore/core.cpp Fixed Show fixed Hide fixed
srtcore/core.cpp Outdated
@@ -5550,7 +5561,7 @@ void * srt::CUDT::tsbpd(void* param)
if (self->m_bClosing)
break;

SRT_ATR_UNUSED bool bWokeUpOnSignal = true;
bool bWokeUpOnSignal = true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scope of this variable can be reduced. It is used both in the if and else statements, but independently. Thus can be defined inside those.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, this was likely tied to some earlier version that provided some log instruction after this if-branch, hence the scope was bigger. Now it has its own log in every branch, so this isn't necessary.

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.

Project coverage is 68.63%. Comparing base (5f16494) to head (83fcba8).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
srtcore/core.cpp 66.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1709      +/-   ##
==========================================
+ Coverage   65.75%   68.63%   +2.87%     
==========================================
  Files         101      101              
  Lines       17966    18327     +361     
==========================================
+ Hits        11814    12579     +765     
+ Misses       6152     5748     -404     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maxsharabayko
Copy link
Collaborator

Tested on a Raspberry Pi3 alike platform.
Hard to tell for sure from a single run, but might be a small performance degradation of the TSBPD thread.

This PR
image

SRT v1.5.4 master 2024-12-12 f109fb1
image

@maxsharabayko
Copy link
Collaborator

Second run.

This PR.
image

Master 2024-12-12 f109fb1
image

@maxsharabayko
Copy link
Collaborator

Third run

This PR.
image

Master 2024-12-12 f109fb1
image

@ethouris
Copy link
Collaborator Author

ethouris commented Jan 6, 2025

Would you be able to check also a similar version, just in place where there's a wait on tsbpd_cc just replace the timely waiting with forever waiting, while assigning true to the boolean variable?

Hard to believe that this is the point of performance degradation, but there are about 3 candidates among the changes that could cause it. I also hope that you made the measurements on C++11 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants