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 packet drop when reading from members #1784

Merged

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented Feb 2, 2021

TSBPD thread of a group member might not yet trigger epoll read-ready event, while it is potentially ready.
If another member signals read-readiness ahead of the current position it will result in a packet drop by a group.

This PR changes the logic of a group waiting for read-readiness.
When a notification is received, not only notified sockets are added to the reading list, but also those not notified, but with receiver buffer ready to read.

Fixes #1755
Fixes: #1757 (likely the same reason, tests show no losses when switching back)

TSBPD thread of a member socket might not yet trigger epoll read-ready
event, while it is potentially ready.
If another member signals read-readiness ahead of the current position
it will result in a packet drop by a group.
@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Feb 2, 2021
@maxsharabayko maxsharabayko added this to the v1.4.3 milestone Feb 2, 2021
@maxsharabayko maxsharabayko self-assigned this Feb 2, 2021
srtcore/group.cpp Outdated Show resolved Hide resolved
@maxsharabayko
Copy link
Collaborator Author

Changed m_pRcvBuffer->getRcvFirstMsg(..) to m_pRcvBuffer->isRcvDataReady(). Testing...

@maxsharabayko
Copy link
Collaborator Author

maxsharabayko commented Feb 4, 2021

30 test runs, no losses 👍

Receiver-caller

srt-xtransmit receive "srt://192.168.1.91:4200?grouptype=backup&weight=75&latency=800"
    "srt://192.168.1.91:4201?weight=25" --statsfile backup-stats-rcv.csv --statsfreq 1s --enable-metrics

Sender-listener

srt-xtransmit generate srt://:4200 srt://:4201 --sendrate 500kbps --duration 5s --enable-metrics --reconnect -v
Main Link (port 4200) Backup Link (port 4201) Bitrate, Mbps SRT Latency
RTT1 = 200 ms,
weight 75 (slow link)
RTT2 = 100 ms,
weight 25
0.5 800 ms

@maxsharabayko maxsharabayko merged commit 8845473 into Haivision:master Feb 4, 2021
@maxsharabayko maxsharabayko deleted the hotfix/group-drop-panda branch February 4, 2021 13:47
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
2 participants