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

Issue of abnormal disconnection of TCP connection in live streaming pull end unable to release #1044

Closed
juntaoliu opened this issue Jan 7, 2018 · 3 comments
Assignees
Labels
Bug It might be a bug. TransByAI Translated by AI/GPT.
Milestone

Comments

@juntaoliu
Copy link
Contributor

juntaoliu commented Jan 7, 2018

When using the cluster mode of SRS, consider the following scenarios:

When using a player to play a live stream from the edge, the following scenario should be considered:

When establishing a playback connection (e.g., C1) from the edge, the edge will initiate an ingest connection (C2) with the origin server to pull the live stream. If the stream exists at that time, the live stream can be played normally. This is the normal usage mode of the cluster mode.

However, if the live stream has not started streaming yet or if there is no such stream at all, the connection C1 from the edge will be maintained until the live stream arrives.

If, at this time, a network anomaly causes the communication between the player and the edge to be disconnected (such as network interruption or sudden power failure), in this case, the playback connection C1 established by the player does not disconnect properly because the player side does not have the opportunity to send a TCP connection termination FIN.

In this situation, the connection C1 becomes a persistent TCP connection, but the client side of this TCP connection cannot be recovered.

If the live stream starts pushing, the edge will attempt to send data into the TCP connection and will find that the TCP connection is no longer active, so it will close the TCP connection.

But what if this stream doesn't exist at all?

Then this TCP connection C1 will continue to exist and will not be released until SRS is restarted.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Jan 7, 2018

This should be similar to when one side of the network cable is unplugged, and the other side needs to detect the disconnection. Generally, in the TCP layer, KEEPALIVE is used to detect whether the connection is disconnected.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Jan 7, 2018

I changed it to SRS_PERF_SO_KEEPALIVE, which is not enabled by default. That's how SRS2 is now.
In SRS3, if you think it should be enabled by the user, you can change it to read the configuration. If there are no issues with enabling it, then it should be enabled by default.

TRANS_BY_GPT3

@winlinvip winlinvip added this to the srs 3.0 release milestone Jan 7, 2018
@winlinvip
Copy link
Member

Fixed.

@winlinvip winlinvip self-assigned this Sep 12, 2021
@winlinvip winlinvip added the Bug It might be a bug. label Sep 12, 2021
@winlinvip winlinvip changed the title 直播拉流端异常断开TCP连接无法释放的问题 Issue of abnormal disconnection of TCP connection in live streaming pull end unable to release Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug It might be a bug. TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

2 participants