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 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 added 2 commits May 18, 2016
@ssalinas ssalinas modified the milestone: 0.8.0 May 19, 2016
@ssalinas ssalinas added the hs_staging label Jun 6, 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());

This comment has been minimized.

Copy link
@tpetr

tpetr Jun 6, 2016

Member

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

This comment has been minimized.

Copy link
@ssalinas

ssalinas Jun 6, 2016

Author Member

thanks, updated

ssalinas added 2 commits Jun 6, 2016
@ssalinas ssalinas added the hs_qa label Jun 6, 2016
@ssalinas ssalinas added the hs_stable label Jun 14, 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
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.