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

[BUG] The values of RTT and bandwidth stored in cache might be unavailable #1958

Open
mbakholdina opened this issue Apr 19, 2021 · 1 comment
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@mbakholdina
Copy link
Collaborator

mbakholdina commented Apr 19, 2021

Describe the Bug

Currently, the values of RTT and bandwidth are stored in cache during the socket closing, see function bool CUDT::closeInternal() (core.cpp):

// Store current connection information.
CInfoBlock ib;
ib.m_iIPversion = m_PeerAddr.family();
CInfoBlock::convert(m_PeerAddr, ib.m_piIP);
ib.m_iRTT       = m_iRTT;
ib.m_iBandwidth = m_iBandwidth;
m_pCache->update(&ib);

As a result, they can be used and extracted from cache only once the socket is closed. The socket closing happens at the background and takes some time to execute. The values from cache can be used when creating another socket with the same target IP if only the previous one has been closed already.

This leads to the following problems:

  • We might need to create several sockets with the same target IP one after another (almost in parallel) and it's reasonable to use the values from cache from one of the already created and functioning sockets. However, this isn't possible with the current implementation.
  • For resumed connection, while the new socket is being created, the previous one is probably still not closed. As a result, we have no cache or some old data stored from the previous sessions (in case of multiple reconnections).

To Reproduce

See PR #1957, test case 2.1 for the reproduction steps and screenshots.

@mbakholdina mbakholdina added the Type: Bug Indicates an unexpected problem or unintended behavior label Apr 19, 2021
@ethouris
Copy link
Collaborator

My proposal: record the values every time ACK is coming in. Finding the right place for recording it at the moment of closing could be non-trivial - at least when distinguishing closing on the application, connection closed by SHUTDOWN and connection broken by timeout. This would be also the only way to make it available for parallel connection over the same network pathway.

@mbakholdina mbakholdina added this to the v1.4.4 milestone Apr 19, 2021
@mbakholdina mbakholdina added the [core] Area: Changes in SRT library core label Apr 19, 2021
@maxsharabayko maxsharabayko modified the milestones: v1.4.4, Backlog Aug 12, 2021
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

No branches or pull requests

3 participants