rivet-gg / rivet

🔩 The only backend your multiplayer game needs. Open-source & self-hostable.
https://rivet.gg
Apache License 2.0
2.06k stars 47 forks source link

Adjust lobby log throttler to always show the last N logs #775

Open ABCxFF opened 5 months ago

ABCxFF commented 5 months ago

Description

If a server crashes, we should send the last N logs of the server no matter what since that usually contains the crash info.

The following is a problematic scenario that can take place with the current lobby's log throttler system:

  1. Malicious user starts attempting to attack server
  2. Connections spam and cause unexpectedly high amounts of logs printed
  3. Logs get ratelimitted
  4. Malicious user successfully crashes the server but stacktrace and final debug information is never shown due to the fact the logs are being truncated by the ratelimitter

Alternatives solutions

Solution would be to strictly save the last 50-100 logs no matter what. If the ratelimit happens to be hit, then only begin deleting logs after they get old aka only delete it's not in the last 50 lines.

Prior art

linear[bot] commented 5 months ago

RVT-3748 Adjust lobby log throttler to always show the last N logs

NathanFlurry commented 5 months ago

Will likely go with the last X lines no matter what.