OneSync: clients dropped with "Timed out after 60 seconds (2)" since frame retention change (38386+)
What happened?
Since we updated FXServer from 37850 to 38386 (and later to 38435), players get dropped in waves with OneSync missed-frame reasons:
Timed out after 60 seconds (2)Timed out after 60 seconds (1, <frames>, <ms>), for example(1, 0, 761)and(1, 0, 30)
Daily count of these drop reasons on one server, about 60-80 players at peak, same resources and same host throughout:
| Period | Artifact | Drops per day |
|---|---|---|
| 30 Sep - 5 Nov | up to 37850 | 0-6 |
| 6 Nov - 11 Nov | 38386, then 38435 | 17-40, every day |
Server->client connection timed out drops stayed at the same level before and after the update. The server itself is healthy when this happens: no hitch warnings, around 90% CPU idle, no interface drops, and other outbound services on the machine keep working. Several players are dropped within a few seconds of each other. For example, 17 out of 65 players dropped between 19:57:34 and 19:58, and most of them reconnected right away.
We think this comes from bd847270 ("fix(sync): retain frames based on client silence"). The old check was client->GetLastSeen() > 5s. GetLastSeen() is an epoch timestamp, so that check was always true, and every client kept the worst-case backlog of maxSavedClientFramesWorstCase (~60 s). ShouldUseWorstCaseFrameBacklog now uses the time elapsed since the last update (since d34c31a7, since the last game state update). A client that falls more than ~650 frames (~8-9 s) behind while still sending some packets therefore has its frames erased. When it NAcks one of those frames it is dropped in HandleGameStateNAck ("(1, ...)") or because the frame no longer exists ("(2)").
The bug fix itself makes sense. In practice, though, the retention window dropped from ~60 s to ~8-9 s for every client, so a short network hiccup that clients used to recover from now disconnects them.
Expected result
A client that falls behind for 10-20 seconds should recover, as it did on 37850, rather than being dropped with a 60-second timeout message.
Reproduction steps
- Run a populated OneSync server on 38386 or newer.
- Add a ~10-15 s stall or heavy packet loss on a client's downstream while the client keeps sending (for example with clumsy on the client, or a short network interruption).
- Expected per the code above: the client is dropped with
Timed out after 60 seconds (2)or(1, x, y), while on 37850 it would still have 60 s of frames. We have not run this controlled test yet; our data comes from the production numbers above.
Importancy
There's a workaround
Area(s)
FXServer
Specific version(s)
FXServer linux 38386 and 38435 (current recommended). Not seen on 37850. As far as we can see, the relevant code is unchanged in 38621.
Additional information
Our workaround is to roll back to 37850. A server convar for the minimum frame retention, or using the worst-case backlog whenever the client is behind (rather than only after 5 s of silence), would let us move back to recommended builds.
I’m on version 38343 and am experiencing the same issue. I can’t perform the download because I primarily use Steam as an authentication method for my server.
Estou enfrentando exatamente o mesmo problema também, não só eu, mas vários outros jogadores também. Ele CONGELA E TRAVA o tempo todo, e está afetando os servidores em todo o FiveM. Esta nova versão/ATUALIZAÇÃO está realmente quebrando o jogo para os jogadores. I'm getting the exact same timeout error too.
Your analysis checks out, I could reproduce it locally: a client that stops receiving for longer than the default backlog while still sending gets dropped with (1, ...). Opened a PR that adds onesync_minFrameRetention (seconds) so you can keep the old ~60 s behaviour without rolling back: https://github.com/citizenfx/fivem/pull/4400
With it set to 30, a 25 s stall recovered fine in my tests.
well, that seems to be a common problem for more users and not only for you/me. hoping that fivem team would fix this error asap, because customers aren't so indulgent like us (hosters, server owners, what so ever). ^^ UP.
+1
Update from our side: rolled back to 37850 on Nov 12 and the drops are gone. Daily count of Timed out after 60 seconds went 15 / 20 (Nov 10-11, on 38386+) → 6 (Nov 12, rollback day) → 0 (Nov 13). Same players, same network. #4400 would let us update again without losing this, would appreciate a review on it.
[06:22:35][3] SANTAdisconnected (Timed out after 60 seconds (1, 422, 432))
You also often receive them simply in between.
@Gogsi