configurable max metadata message length #1045

Merged
merged 4 commits into from Jul 1, 2016

Conversation

Projects
None yet
2 participants
@ssalinas
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 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.

@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

@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.

@ssalinas

ssalinas Jun 6, 2016

Member

thanks, updated

@ssalinas

ssalinas Jun 6, 2016

Member

thanks, updated

ssalinas added some 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

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