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

Bugfix: properly handle cases of stale loss report #1079

Merged

Conversation

ethouris
Copy link
Collaborator

The reason for this change is that the case of the "stale loss report" so far wasn't handled at all.

The UDT handler provided only a case when a loss report covers PARTIALLY the already dismissed range from the sender buffer, but hooks up at least to some packets that are in the sender buffer. This normally should never happen, but the socket group code involving sequence number resynchronization has made this more probable to happen.

This fix only increases the probability to fix things up (as a UDP packet can still be lost), but it's required to not make the receiver hang around uselessly in case when it tried to recover packets that have never be predicted to be sent.

The signal to TSBPD in case when the dropping is received is required because otherwise TSBPD may hangup forever when it happens, and TLPKTDROP doesn't release it.

The SRT_TEST_DISABLE_KEY_CONTROL_PACKET is for testing purposes only - to test what happens when these drop request command packets happen to not be sent.

The quick exit at processData is here because an odd moment of closing the socket might cause the packet to be uselessly processed. This might not be the problem for single sockets, but could cause additional confusion if it's a member of the group.

@ethouris ethouris added Priority: High Type: Maintenance Work required to maintain or clean up the code [core] Area: Changes in SRT library core Impact: Significant labels Jan 21, 2020
@ethouris ethouris added this to the v1.5.0 milestone Jan 21, 2020
@ethouris ethouris self-assigned this Jan 21, 2020
srtcore/core.cpp Outdated Show resolved Hide resolved
srtcore/core.cpp Show resolved Hide resolved
srtcore/core.cpp Outdated
Comment on lines 7770 to 7772
#ifndef SRT_TEST_DISABLE_KEY_CONTROL_PACKETS
sendCtrl(UMSG_DROPREQ, &w_packet.m_iMsgNo, seqpair, sizeof(seqpair));
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we should add this to the master. This will be forgotten eventually.
I would suggest to create a document, and maybe a patch, that describe how to perform this test.
Roughlt speaking. disable all sendCtrl(UMSG_DROPREQ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This sendCtrl must remain here - that's the intention of the fix. The macrodefinition is here so that tests can be made that simulate dropping this packet.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was talking about the ifdef statement. Code pollution.
SRT_TEST_DISABLE_KEY_CONTROL_PACKETS can be easily added inside of the sendCtrl() when needed. But they should not exist in master.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah ok, then you are right. Moreover, with more advanced testing we can disable them using some better methods.

@maxsharabayko maxsharabayko merged commit 617fb80 into Haivision:master Jan 22, 2020
@mbakholdina mbakholdina modified the milestones: v1.5.0, v1.4.2 Oct 14, 2020
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 Priority: High Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants