fix: increase packet parse/callback budgets to fix Warden module stall

Warden module download (18756 bytes, 38 chunks of 500 bytes) stalled at
32 chunks because the per-pump packet parse budget was 16 — after two
2ms pump cycles (32 packets), the TCP receive buffer filled and the
server stopped sending. Character list never arrived.

- kDefaultMaxParsedPacketsPerUpdate: 16 → 64
- kDefaultMaxPacketCallbacksPerUpdate: 6 → 48

Also adds WARNING-level diagnostic logs for auth pipeline packets and
Warden module download progress (previously DEBUG-only, invisible in
production logs).
This commit is contained in:
Kelsi 2026-03-28 10:28:20 -07:00
parent 6a46e573bb
commit ed8ff5c8ac
3 changed files with 7 additions and 6 deletions

View file

@ -4104,7 +4104,8 @@ void GameHandler::handlePacket(network::Packet& packet) {
++wardenPacketsAfterGate_; ++wardenPacketsAfterGate_;
} }
if (preLogicalOp && isAuthCharPipelineOpcode(*preLogicalOp)) { if (preLogicalOp && isAuthCharPipelineOpcode(*preLogicalOp)) {
LOG_DEBUG("AUTH/CHAR RX opcode=0x", std::hex, opcode, std::dec, LOG_WARNING("AUTH/CHAR RX opcode=0x", std::hex, opcode, std::dec,
" logical=", static_cast<uint32_t>(*preLogicalOp),
" state=", worldStateName(state), " state=", worldStateName(state),
" size=", packet.getSize()); " size=", packet.getSize());
} }
@ -4385,7 +4386,7 @@ void GameHandler::sendAuthSession() {
} }
void GameHandler::handleAuthResponse(network::Packet& packet) { void GameHandler::handleAuthResponse(network::Packet& packet) {
LOG_INFO("Handling SMSG_AUTH_RESPONSE"); LOG_WARNING("Handling SMSG_AUTH_RESPONSE, size=", packet.getSize());
AuthResponseData response; AuthResponseData response;
if (!AuthResponseParser::parse(packet, response)) { if (!AuthResponseParser::parse(packet, response)) {

View file

@ -380,7 +380,7 @@ void WardenHandler::handleWardenData(network::Packet& packet) {
std::vector<uint8_t> resp = { 0x00 }; // WARDEN_CMSG_MODULE_MISSING std::vector<uint8_t> resp = { 0x00 }; // WARDEN_CMSG_MODULE_MISSING
sendWardenResponse(resp); sendWardenResponse(resp);
wardenState_ = WardenState::WAIT_MODULE_CACHE; wardenState_ = WardenState::WAIT_MODULE_CACHE;
LOG_DEBUG("Warden: Sent MODULE_MISSING, waiting for module data chunks"); LOG_WARNING("Warden: Sent MODULE_MISSING for module size=", wardenModuleSize_, ", waiting for data chunks");
break; break;
} }
@ -404,7 +404,7 @@ void WardenHandler::handleWardenData(network::Packet& packet) {
decrypted.begin() + 3, decrypted.begin() + 3,
decrypted.begin() + 3 + chunkSize); decrypted.begin() + 3 + chunkSize);
LOG_DEBUG("Warden: MODULE_CACHE chunk ", chunkSize, " bytes, total ", LOG_WARNING("Warden: MODULE_CACHE chunk ", chunkSize, " bytes, total ",
wardenModuleData_.size(), "/", wardenModuleSize_); wardenModuleData_.size(), "/", wardenModuleSize_);
// Check if module download is complete // Check if module download is complete

View file

@ -15,10 +15,10 @@
namespace { namespace {
constexpr size_t kMaxReceiveBufferBytes = 8 * 1024 * 1024; constexpr size_t kMaxReceiveBufferBytes = 8 * 1024 * 1024;
constexpr int kDefaultMaxParsedPacketsPerUpdate = 16; constexpr int kDefaultMaxParsedPacketsPerUpdate = 64;
constexpr int kAbsoluteMaxParsedPacketsPerUpdate = 220; constexpr int kAbsoluteMaxParsedPacketsPerUpdate = 220;
constexpr int kMinParsedPacketsPerUpdate = 8; constexpr int kMinParsedPacketsPerUpdate = 8;
constexpr int kDefaultMaxPacketCallbacksPerUpdate = 6; constexpr int kDefaultMaxPacketCallbacksPerUpdate = 48;
constexpr int kAbsoluteMaxPacketCallbacksPerUpdate = 64; constexpr int kAbsoluteMaxPacketCallbacksPerUpdate = 64;
constexpr int kMinPacketCallbacksPerUpdate = 1; constexpr int kMinPacketCallbacksPerUpdate = 1;
constexpr int kMaxRecvCallsPerUpdate = 64; constexpr int kMaxRecvCallsPerUpdate = 64;