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

Fix silent loss of last command to _bulk and _msearch due to missing newline #25740

Merged
merged 1 commit into from Aug 8, 2017

Conversation

@olcbean
Copy link
Contributor

commented Jul 16, 2017

According to the docs _msearch and _bulk requests must end with \n.

NOTE: the final line of data must end with a newline character \n

However if that following _bulk request body is sent:

{ "index" : { "_index": "test-index", "_type": "test-type", "_id": "1"} }
{ "foo": "bar" }
{ "index" : { "_index": "test-index", "_type": "test-type", "_id": "1"} }
{ "foo": "barbar" }

( no \n at the end ), the second action is silently ignored.

With this PR if there is a byte after the last \n ( even \x00 ) an exception is thrown.

Fixes #7601

@elasticmachine

This comment has been minimized.

Copy link
Collaborator

commented Jul 16, 2017

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2017

@elasticmachine ok to test

@jpountz

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2017

@elasticmachine Please test it.

1 similar comment
@jpountz

This comment has been minimized.

Copy link
Contributor

commented Jul 27, 2017

@elasticmachine Please test it.

@jpountz

This comment has been minimized.

Copy link
Contributor

commented Jul 28, 2017

For the record, the failures that CI found also reproduce on the previous commit so I believe they were not introduced by this PR. @s1monw Are you ok with merging this?

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Aug 4, 2017

@jpountz I am ok with it

@s1monw
s1monw approved these changes Aug 4, 2017
Copy link
Contributor

left a comment

LGTM

@jpountz jpountz merged commit 5c4c1c5 into elastic:master Aug 8, 2017

1 of 2 checks passed

elasticsearch-ci Build finished.
Details
CLA Commit author has signed the CLA
Details
@jpountz

This comment has been minimized.

Copy link
Contributor

commented Aug 8, 2017

Thank you @olcbean !

jpountz added a commit that referenced this pull request Aug 8, 2017
jpountz added a commit that referenced this pull request Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.