fix(plugin-meetings): too many media requests sent to Homer #4512
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
COMPLETES #SPARK-719044
This pull request addresses
Sometimes we can get into a state where we will be flooding Homer with media requests:
it's caused by an optimization in Homer where they send us "live" source state for a remote participant after they receive a media request from us even before they are 100% sure that that participant is actually sending video, so if that participant is actually not sending video, very soon afterwards (within milliseconds) they send us another update with "avatar" source state. Each such update may cause us to send a new media request (because we have different number of live remote participants, so we adjust the maxFs in the requests to not go over the
this.degradationPreferences.maxMacroblocksLimit). Our new media requests can trigger Homer again to send us a fake "live", so we get into a loop.by making the following changes
Added throttling of sendMediaRequests() that's called as a result of Homer notifications:
Homer team wanted us to throttle this at 5s, but I've set it to 2s, because 5s seems a bit long. In the logs from the jira Homer was sending us the fake "live" followed by "avatar" within milliseconds, so 2s should be enough in most cases.
There is 1 use case where user can see the delay caused by this throttling:
Change Type
The following scenarios where tested
unit tests
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
I have read and followed contributing guidelines
I discussed changes with code owners prior to submitting this pull request
I have not skipped any automated checks
All existing and new tests passed
I have updated the documentation accordingly
Make sure to have followed the contributing guidelines before submitting.