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.
When a session stops receiving messages, we would keep saving all the missed messages would would cause memory usage to balloon. This PR protects core from these misbehaving sessions.
This PR adds back pressure on
FlatbufferServer
by limitingsessionChannel
to storing a max of 60 items. I think this is a fair number, but if there's crazy amounts ofMatchComm
messages being sent around it might be be enough? The limit can be increased later if needed.If a session misses a message, a warning is printed. In order to not spam the console, exponential backoff has been implemented to a power of 10 (do we want to do the power of 2?) so it will print on the 1st missed message, then the 10th, 100th, 1000th, etc. Example of this warning:
This warning has only been implemented for when
BallPrediction
/GamePacket
are added tosessionChannel
because of the high frequency with which they are consistently sent, adding it to these alone is likely enough to flag the problem.