pixie icon indicating copy to clipboard operation
pixie copied to clipboard

[Parse incomplete chunks 4/9] Add HTTP lazy parsing

Open benkilimnik opened this issue 2 years ago • 0 comments

Summary: Instead of relying on filler events with large null byte allocations, we should parse as far as possible up to the gap for incomplete events. Such lazy parsing lets us capture partial frames if we know from bpf that a gap is coming.

This PR modifies the HTTP protocol parser to support lazy parsing. This behavior is controlled by a flag, which is disabled by default (hence these changes should be a no-op). The following PRs integrate this into the event parser and add a feature flag.

To avoid masking unrelated errors, we push a partial frame only if we know there is a gap coming. In those cases, the parser returns a new ParseState kMetadataComplete indicating that we successfully parsed the minimum amount of information needed to successfully stitch a frame.

Type of change: /kind feature

Test Plan: Added unittests to http/body_decoder_test.cc. http/parse_test.cc is updated in a following PR where lazy parsing is integrated in the event parser.

Additional Context: #1755

benkilimnik avatar Nov 29 '23 21:11 benkilimnik