Skip to content

Fix routing with leading or trailing whitespace #27712

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

Conversation

jasontedor
Copy link
Member

@jasontedor jasontedor commented Dec 7, 2017

The problem here is that splitting was using a method that intentionally trims whitespace (the method is really meant to be used for splitting parameters where whitespace should be trimmed like list settings). However, for routing values whitespace should not be trimmed because we allow routing with leading and trailing spaces. This commit switches the parsing of these routing values to a method that does not trim whitespace.

Closes #27708

The problem here is that splitting was using a method that intentionally
trims whitespace (the method is really meant to be used for splitting
parameters where whitespace should be trimmed like list
settings). However, for routing values whitespace should not be trimmed
because we allow routing with leading and trailing spaces. This commit
switches the parsing of these routing values to a method that does not
trim whitespace.
@jasontedor jasontedor added :Search/Search Search-related issues that do not fall into other categories review v5.6.6 v6.0.2 v6.1.0 v6.2.0 v7.0.0 >bug labels Dec 7, 2017
…space

* master:
  Add test for writer operation buffer accounting (elastic#27707)
  [TEST] Wait for merging to complete before testing breaker
Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we should fix the Strings.splitStringByCommaToSet functionality too though (I see Nhat already opened an issue for this)

@jasontedor
Copy link
Member Author

What is wrong with it? Is it not doing what we want it doing be doing? We have unit tests exactly for that behavior. We seem to be using it in places where we have decided that we want whitespace stripped (personally, I am opposed to this, but I lost that argument).

Relates #22591

@jasontedor
Copy link
Member Author

test this please

@jasontedor
Copy link
Member Author

@dakrone Okay, I opened #27715. I renamed the method, I hope this removes the confusion. The behavior can not change, it is doing what we want it to do.

@jasontedor jasontedor merged commit ec5e540 into elastic:master Dec 8, 2017
jasontedor added a commit that referenced this pull request Dec 8, 2017
The problem here is that splitting was using a method that intentionally
trims whitespace (the method is really meant to be used for splitting
parameters where whitespace should be trimmed like list
settings). However, for routing values whitespace should not be trimmed
because we allow routing with leading and trailing spaces. This commit
switches the parsing of these routing values to a method that does not
trim whitespace.

Relates #27712
jasontedor added a commit that referenced this pull request Dec 8, 2017
The problem here is that splitting was using a method that intentionally
trims whitespace (the method is really meant to be used for splitting
parameters where whitespace should be trimmed like list
settings). However, for routing values whitespace should not be trimmed
because we allow routing with leading and trailing spaces. This commit
switches the parsing of these routing values to a method that does not
trim whitespace.

Relates #27712
jasontedor added a commit that referenced this pull request Dec 8, 2017
The problem here is that splitting was using a method that intentionally
trims whitespace (the method is really meant to be used for splitting
parameters where whitespace should be trimmed like list
settings). However, for routing values whitespace should not be trimmed
because we allow routing with leading and trailing spaces. This commit
switches the parsing of these routing values to a method that does not
trim whitespace.

Relates #27712
jasontedor added a commit that referenced this pull request Dec 8, 2017
The problem here is that splitting was using a method that intentionally
trims whitespace (the method is really meant to be used for splitting
parameters where whitespace should be trimmed like list
settings). However, for routing values whitespace should not be trimmed
because we allow routing with leading and trailing spaces. This commit
switches the parsing of these routing values to a method that does not
trim whitespace.

Relates #27712
@jasontedor jasontedor deleted the fix-routing-with-leading-or-trailing-whitespace branch December 8, 2017 16:34
@jasontedor jasontedor added v6.1.1 and removed v6.1.0 labels Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories v5.6.6 v6.0.2 v6.1.1 v6.2.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants