Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 384 redis fail #402

Merged
merged 8 commits into from
Nov 26, 2015
Merged

Bug 384 redis fail #402

merged 8 commits into from
Nov 26, 2015

Conversation

urso
Copy link

@urso urso commented Nov 26, 2015

resolves #384

Fix a number of issues found in redis protocol plugin:

  • parsing errors (see commit messages)
  • add piping support
  • fix panic on nil

urso added 5 commits November 25, 2015 20:28
Do not set message.Bulks to nil after setting message to nil
Parse strings not until CRLF, but use message length field to get full message.
Fixes poblems with messages bodies containing CRLF.
split parser and unexport/rename some types
Add support for pipelining by storing all requests and responses in lists
to be correlated by order. Responses without requests are dropped (original
behavior). If TCP connection times out, the response will be lost too.
Added unit tests for cases redis parser has had problems with + rewrite parser
to fix those issues.

- length prefixed strings containing '\r\n' have not been fully read => message
  dropped => connection/correlation in invalid state
- nested arrays parsing 'unreliable' (code did assume no nesting)
- restart/continue parsing is message is split in multiple TCP segments.
  Internal parser state was invalid such that TCP stream was sometimes not fully
  processed at all and transaction have been dropped or message required to be
  dropped ending in potentially wrong correlations.
@andrewkroh
Copy link
Member

LGTM. Looks like you found more issues than just the one you were initially after.

@ruflin
Copy link
Contributor

ruflin commented Nov 26, 2015

LGTM. Also the renaming / cleanup part is nice.

ruflin added a commit that referenced this pull request Nov 26, 2015
@ruflin ruflin merged commit 7bb21e6 into elastic:master Nov 26, 2015
@urso urso deleted the bug/384-redis-fail branch November 26, 2015 16:32
tsg pushed a commit to tsg/beats that referenced this pull request Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash parsing Redis traffic
3 participants