You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-19 15:06:19 +00:00
1c4449fb88
The /api/auth/* handlers ran inline on the Netty worker event loop, so their blocking work — BCrypt (cost 12 ~tens of ms), JDBC, the Turnstile HTTPS round-trip and SMTP — stalled every other client multiplexed on that thread; a burst of logins/registers could freeze game traffic. Dispatch each auth request to a dedicated bounded pool (4..16 daemon threads, bounded queue, 503 on saturation) instead. It is deliberately SEPARATE from the shared game ThreadPooling so auth load can't starve room cycles either. Netty writes are thread-safe, so the endpoints' sendJson calls work unchanged from the worker; the FullHttpRequest is released when the task finishes. Caveat: this allows concurrent handling of pipelined requests on a single keep-alive connection (out-of-order responses) — not a concern for the Nitro client which is strictly request/response, but worth load-testing before prod.