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
4eb1484daf
Root cause from the CPU audit: every incoming packet handler ran on the Netty I/O event loop (MULTI_THREADED_PACKET_HANDLING is false by default), so any blocking handler — login DB + loadHabbo, friends/polls/catalog/guild-forum JDBC (~48 handlers), synchronous A* per walk — stalled socket I/O for every other client sharing that I/O thread. - WebSocketChannelInitializer: register GameMessageHandler on a dedicated DefaultEventExecutorGroup (max(16, 2x cores), daemon). Netty pins each channel to one executor in the group, so a client's packets stay strictly ordered (no new intra-client races) while blocking work moves off the I/O loop. The cross-client concurrency degree matches the already-multi-threaded I/O group, and this is strictly safer than the existing (order-losing) shared-pool MULTI_THREADED_PACKET_HANDLING mode the codebase already supported. - GameMessageHandler: always run the handler inline (now on the group thread); drop the shared-pool branch (which would break per-channel ordering and also removes the rejectable-pool ByteBuf-drop path). - PathfinderImpl: default the A* execution-time guard ON (25ms) so a pathological search returns an empty path instead of running unbounded on its thread. Note: this changes the server's packet-threading model — verified to compile, unit-test, and assemble the shaded jar, but should be load-tested before prod. Group size is currently derived from CPU count; can be made a config key if tuning is needed.