Skip to content

fix(server/impl): rate limit latent event acks separately - #4246

Open
manzarek123 wants to merge 1 commit into
citizenfx:masterfrom
manzarek123:fix/latent-ack-rate-limit
Open

manzarek123 wants to merge 1 commit into
citizenfx:masterfrom
manzarek123:fix/latent-ack-rate-limit

Conversation

@manzarek123

Copy link
Copy Markdown
Contributor

Acks for server-to-client latent events arrive through the same msgReassembledEventV2 handler as client-sent fragments, so they consume the latentEvent limiter (75/s, burst 125). The client acks every fragment it receives, so a transfer above ~150 KB/s exceeds that limit. The excess acks are silently dropped, and the server keeps resending fragments the client already has. Large latent events become much slower and waste bandwidth.

Fix: check the limiters after parsing, and give acks their own latentEventAck limiter (1000/s, burst 2000, configurable through rateLimiter_latentEventAck_rate / _burst). Acks over the limit are dropped silently, never kicked. Client-sent fragments keep the existing latentEvent / latentEventFlood limits unchanged. Malformed packets no longer consume any budget.

This PR applies to the following area(s)

Server

Successfully tested on

36897

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

#4244

@github-actions github-actions Bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant