Skip to content

fix: parse pipelined redis messages#11827

Open
hengyoush wants to merge 1 commit into
deepflowio:mainfrom
hengyoush:agent/redis-pipeline-parser
Open

fix: parse pipelined redis messages#11827
hengyoush wants to merge 1 commit into
deepflowio:mainfrom
hengyoush:agent/redis-pipeline-parser

Conversation

@hengyoush

@hengyoush hengyoush commented Jul 24, 2026

Copy link
Copy Markdown

This PR is for:

  • Agent

Fixes #11828

Redis L7 logs are missing for pipelined messages coalesced into a single TCP payload.

Steps to reproduce the bug

  1. Send two Redis commands through pipelining so both RESP commands are carried in one TCP payload.
  2. Return both Redis responses in one TCP payload.
  3. Observe that the parser emits only the first request and response. The remaining command has no L7 log and cannot be paired with its response.

Root cause

The Redis parser tracked request state with a single boolean and decoded only one top-level RESP message per payload. Redis pipelining can place multiple commands or responses in the same TCP payload, so messages after the first were skipped.

Changes to fix the bug

  • Parse every complete Redis command or response in a TCP payload and return multiple L7 records when needed.
  • Pair pipelined requests and responses with FIFO session IDs, starting at 1 to avoid the reserved non-multiplexed session key.
  • Record each message's TCP sequence offset so coalesced records retain their actual stream position.
  • Preserve the first complete command when a trailing command is truncated.
  • Add regression coverage for coalesced requests, coalesced responses, FIFO pairing, offsets, and truncated trailing commands.

Affected branches

  • main

Checklist

  • Added unit tests to verify the fix.
  • Verified eBPF program runs successfully on linux 4.14.x. (Not applicable: protocol parser-only change.)
  • Verified eBPF program runs successfully on linux 4.19.x. (Not applicable: protocol parser-only change.)
  • Verified eBPF program runs successfully on linux 5.2.x. (Not applicable: protocol parser-only change.)

Validation

  • cargo test --lib flow_generator::protocol_logs::sql::redis::tests -- --nocapture (11 passed)
  • cargo fmt --all -- --check
  • RUSTFLAGS='-D warnings -C force-frame-pointers=yes' cargo check --all-targets

@CLAassistant

CLAassistant commented Jul 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@hengyoush
hengyoush marked this pull request as ready for review July 24, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Redis parser drops pipelined messages coalesced in one TCP payload

2 participants