Skip to content

UDP inputs now uses human friendly size to define MaxMessageSize#6886

Merged
ruflin merged 2 commits intoelastic:masterfrom
ph:fix/humanize-udp
Apr 19, 2018
Merged

UDP inputs now uses human friendly size to define MaxMessageSize#6886
ruflin merged 2 commits intoelastic:masterfrom
ph:fix/humanize-udp

Conversation

@ph
Copy link
Copy Markdown
Contributor

@ph ph commented Apr 17, 2018

Uses go-humanize to parse values for MaxMessageSize and fallback to
raw bytes if no suffix is found. Also create a new type for future
configuration named cfgtype.ByteSize that will take care of correctly
unpacking values.

@ph ph added the Filebeat Filebeat label Apr 17, 2018
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

exported type Size should have comment or be unexported

Copy link
Copy Markdown
Contributor

@kvch kvch Apr 17, 2018

Choose a reason for hiding this comment

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

I might be wrong, but AFAIK the prefix "go-" is removed automatically. So you don't need to alias this import.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I really need to fix my editor to stop adding theses.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@kvch Your vim doesn't do that?

@ph
Copy link
Copy Markdown
Contributor Author

ph commented Apr 17, 2018

@kvch updated

@ph
Copy link
Copy Markdown
Contributor Author

ph commented Apr 18, 2018

jenkins test this please

@ph ph added in progress Pull request is currently in progress. review and removed in progress Pull request is currently in progress. review labels Apr 18, 2018
@ph
Copy link
Copy Markdown
Contributor Author

ph commented Apr 18, 2018

@kvch don't merge it yet, I have second thoughts about the name, I think It will go with byteSize instead of size it will a bit more explicit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we rename the variable here to be in line with the config naming? This will make it easier to read the code base.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will rename it to maxMessageSize

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like this as a temporarely fix to make migration easier. But I would remove it again in 7.0 to only have 1 way to configure the values.

This would mean to when someone uses it without a unit, we should log a deprecation warning.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am OK to add a deprecation warning.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ruflin When I tried to use cfgwarn in that file, I hit aimport cycle not allowed, to fix that I have either to move theses new common type out of common OR maybe cfgwarn out of common and have a backward compatible alias? ...

@ph ph added review and removed in progress Pull request is currently in progress. labels Apr 18, 2018
@ph
Copy link
Copy Markdown
Contributor Author

ph commented Apr 18, 2018

@kvch @ruflin renamed updated and added the warning. 👍

Copy link
Copy Markdown
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

I would keep the current default of 10KB as a mutline event can reach that limit pretty easily I'm thinking. If we change it, we should add it to the changelog.

Code LGTM.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry for the late comment, but I just realised we are changing the default here from 10KB to 1KB?

@ph
Copy link
Copy Markdown
Contributor Author

ph commented Apr 19, 2018 via email

@ph
Copy link
Copy Markdown
Contributor Author

ph commented Apr 19, 2018

@ruflin all update good catch, waiting for green.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ph I think you forgot the docs. Also see above.

ph added 2 commits April 19, 2018 09:31
Uses go-humanize to parse values for `MaxMessageSize` and fallback to
raw bytes if no suffix is found. Also create a new type for future
configuration named `cfgtype.ByteSize` that will take care of correctly
unpacking values.
@ph
Copy link
Copy Markdown
Contributor Author

ph commented Apr 19, 2018

@ruflin I've fixed the docs issue and manually rebased to have a cleaner history.

Copy link
Copy Markdown
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

WFG

@ruflin ruflin merged commit 227dc95 into elastic:master Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants