Skip to content

configurable max metadata message length#1045

Merged
ssalinas merged 4 commits into
masterfrom
metadata_size
Jul 1, 2016
Merged

configurable max metadata message length#1045
ssalinas merged 4 commits into
masterfrom
metadata_size

Conversation

@ssalinas

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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
@ssalinas
ssalinas deleted the metadata_size branch July 1, 2016 16:20
@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.

2 participants