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

configurable max metadata message length #1045

Merged
merged 4 commits into from Jul 1, 2016
Merged

configurable max metadata message length #1045

merged 4 commits into from Jul 1, 2016

Conversation

ssalinas
Copy link
Member

@ssalinas ssalinas commented May 18, 2016

Since this is stored in zk, would be wise to limit the length of the message and title so we aren't storing huge objects. Limits are pretty high by default here, open to suggestion for better ones

@ssalinas ssalinas modified the milestone: 0.8.0 May 19, 2016
"Task metadata title too long, must be less than %s bytes", taskMetadataConfiguration.getMaxMetadataTitleBytes());

WebExceptions.checkBadRequest(!taskMetadataRequest.getMessage().isPresent() || taskMetadataRequest.getMessage().get().getBytes().length < taskMetadataConfiguration.getMaxMetadataMessageBytes(),
"Task metadata message too long, must be less than %s bytes", taskMetadataConfiguration.getMaxMetadataMessageBytes());
Copy link
Contributor

@tpetr tpetr Jun 6, 2016

Choose a reason for hiding this comment

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

getBytes() causes the string to be encoded into a byte array, which is kind of wasteful -- i think it's reasonable (and easier to reason about) if we impose the limit as a max length of the title and message Strings

Copy link
Member Author

@ssalinas ssalinas Jun 6, 2016

Choose a reason for hiding this comment

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

thanks, updated

@ssalinas ssalinas added the hs_qa label Jun 6, 2016
@ssalinas ssalinas modified the milestone: 0.8.0 Jun 16, 2016
@ssalinas ssalinas merged commit b3e2441 into master Jul 1, 2016
2 checks passed
@ssalinas ssalinas deleted the metadata_size branch Jul 1, 2016
@ssalinas ssalinas added this to the 0.9.0 milestone Jul 29, 2016
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.

None yet

2 participants