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

When can a relay send SUBSCRIBE_DONE with status SUBSCRIPTION_ENDED? #641

Open
afrind opened this issue Dec 11, 2024 · 3 comments
Open

When can a relay send SUBSCRIBE_DONE with status SUBSCRIPTION_ENDED? #641

afrind opened this issue Dec 11, 2024 · 3 comments

Comments

@afrind
Copy link
Collaborator

afrind commented Dec 11, 2024

  1. Relay has a single client subscribed to a single track with no end group specified
  2. A second client joins with a fixed end group (N)

Here the relay is responsible for generating the SUBSCRIBE_DONE towards client 2, but when?

A triggering event could be a) receiving an END_OF_GROUP status or b) seeing an object with group > N.

The relay could send it immediately when it sees a triggering event, but if it does so, it has to pick the Stream Count at that time, and cannot open any new subgroup streams for late arriving objects in groups <= N.

It could start a timer when it sees the triggering event, and send SUBSCRIBE_DONE with a final stream count when the timer expires.

It would be nice to have a short circuit in this case, but it requires the original publisher include a Stream Count with END_OF_GROUP status. This is also a per-hop value due to DELIVERY_TIMEOUTs that may have expired, which is a little weird, since otherwise object status and content is end-to-end.

@martinduke
Copy link
Contributor

If it's delivered (a) the last group in the SUBSCRIBE or (b) the EndOfTrack object, and it's closed all streams it's going to open.

@afrind
Copy link
Collaborator Author

afrind commented Dec 13, 2024

and it's closed all streams it's going to open.

The relay cannot know this without knowing how many streams the upstream is sending in the last group in SUBSCRIBE.

eg, say subscribe ends at group 2

S->R: G2, SG0, O1
S->R: G2, SG10, O3
S->R, G2, SG20, EOG
S->R: G3, SG0, O1

Are there more subgroups in G2?

@martinduke
Copy link
Contributor

it's not super clean, but at some point it's going to decide to stop, and then it can send DONE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants