ubeddulla opened a new pull request, #3462: URL: https://github.com/apache/brpc/pull/3462
### What problem does this PR solve? Issue Number: Problem Summary: `IndexTable::Init` sizes the HPACK dynamic-table ring buffer as `max_size / (32 + 2)`, assuming every entry is at least 34 bytes. But `AddHeader()` only requires a non-empty name, so a header with an empty value costs `name(1) + value(0) + 32 = 33` bytes (rfc7541 section 4.1). With the default 4096-byte table that leaves room for 124 such entries before eviction fires, while the queue only holds 120, so the 121st `AddHeader()` from a peer trips `CHECK(!_header_queue.full())`. That is a fatal log plus stack trace on every crafted HEADERS block, and a process abort when `-crash_on_fatal_log` is set, all driven straight from HTTP/2 header bytes. ### What is changed and the side effects? Changed: Provision the queue for the real 33-byte minimum entry (`max_size / (32 + 1)`) so eviction always fires before the ring buffer fills. Added a regression test that decodes 121 one-byte-name/empty-value indexed headers, which previously tripped the CHECK. Side effects: - Performance effects: negligible, a few more slots in the dynamic-table ring buffer. - Breaking backward compatibility: none. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
