fix(gateway): harden websocket streaming under client backpressure

This commit is contained in:
2026-09-08 00:18:41 +03:00
parent c730cb818d
commit 7902800ff7
7 changed files with 120 additions and 17 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ matches use the real 60-second reconnect deadline. It performs these checks:
2. Verify heartbeat round-trip latency for all six sessions.
3. Stop consuming one observer stream while Player 1 performs accepted moves;
intermediate observer updates may be dropped, but player acknowledgements
must remain within the reported 250 ms budget.
must remain within the reported 500 ms budget.
4. Flood a second observer with malformed messages. The fixed rate limiter
closes sustained abuse, and the players remain responsive.
5. Complete and authoritatively reset two matches through the real disconnect
+1 -1
View File
@@ -12,7 +12,7 @@ compile-time bounds, not targets that may grow with match duration.
| Outgoing queue | 12 entries | Queue overflow is counted; memory cannot grow. |
| Game command queue | 16 entries | Excess commands receive `queue_full`. |
| Input rate | 20 messages/second | Excess messages are rejected; sustained abuse above 40 in the same window is disconnected. |
| Player response budget | 250 ms | The physical stress client fails above this round-trip threshold. |
| Player response budget | 500 ms | The physical stress client fails above this round-trip threshold. |
| Observer update policy | Latest bounded projection | A busy observer may lose intermediate dynamic chunks and recover on a newer projection. Failed or stalled required sends close the socket. |
| Reconnect deadline | 60,000 ms | Gameplay pauses, then ends in a draw at expiry. |