Replace misleading max_message_size option name
The max_message_size option name is misleading. The option determines max size of message post body. Replacing the option name to max_messages_post_size. Change-Id: Ie01cee026e7ebf530cdb2709e2c17d030ad95480 Closes-Bug: #1357397
This commit is contained in:
parent
0f75fdc64c
commit
6253626829
@ -78,7 +78,7 @@ transport/default_claim_ttl transport
|
||||
transport/default_message_ttl transport
|
||||
transport/max_claim_grace transport
|
||||
transport/max_claim_ttl transport
|
||||
transport/max_message_size transport
|
||||
transport/max_messages_post_size transport
|
||||
transport/max_message_ttl transport
|
||||
transport/max_messages_per_claim_or_pop transport
|
||||
transport/max_messages_per_page transport
|
||||
|
@ -38,7 +38,7 @@
|
||||
<td>(IntOpt) No help text available for this option.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>max_message_size = 262144</td>
|
||||
<td>max_messages_post_size = 262144</td>
|
||||
<td>(IntOpt) No help text available for this option.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -491,7 +491,7 @@
|
||||
|
||||
# (integer value)
|
||||
# Deprecated group/name - [limits:transport]/message_size_uplimit
|
||||
#max_message_size=262144
|
||||
#max_messages_post_size=262144
|
||||
|
||||
# (integer value)
|
||||
# Deprecated group/name - [limits:transport]/message_ttl_max
|
||||
|
@ -51,4 +51,4 @@ port = 8888
|
||||
# Maximum size in bytes allowed for queue metadata and bulk/single
|
||||
# message post bodies (including whitespace and envelope fields).
|
||||
;max_queue_metadata = 65536
|
||||
;max_message_size = 262144
|
||||
;max_messages_post_size = 262144
|
||||
|
@ -7,4 +7,4 @@ storage = sqlalchemy
|
||||
metadata_size_uplimit = 64
|
||||
|
||||
[transport]
|
||||
max_message_size = 256
|
||||
max_messages_post_size = 256
|
||||
|
@ -54,7 +54,7 @@ class TestMessages(base.V1FunctionalTestBase):
|
||||
doc = '[{{"body": "{0}", "ttl": 300}}, {{"body": "{1}", "ttl": 120}}]'
|
||||
overhead = len(doc.format('', ''))
|
||||
|
||||
half_size = (self.limits.max_message_size - overhead) // 2
|
||||
half_size = (self.limits.max_messages_post_size - overhead) // 2
|
||||
doc = doc.format(helpers.generate_random_string(half_size),
|
||||
helpers.generate_random_string(half_size + offset))
|
||||
|
||||
@ -276,7 +276,7 @@ class TestMessages(base.V1FunctionalTestBase):
|
||||
doc = '[{{"body": "{0}", "ttl": 300}}, {{"body": "{1}", "ttl": 120}}]'
|
||||
overhead = len(doc.format('', ''))
|
||||
|
||||
half_size = (self.limits.max_message_size - overhead) // 2
|
||||
half_size = (self.limits.max_messages_post_size - overhead) // 2
|
||||
doc = doc.format(helpers.generate_random_string(half_size),
|
||||
helpers.generate_random_string(half_size + 1))
|
||||
|
||||
|
@ -56,7 +56,7 @@ class TestMessages(base.V1_1FunctionalTestBase):
|
||||
'{{"body": "{1}", "ttl": 120}}]}}')
|
||||
overhead = len(doc.format('', ''))
|
||||
|
||||
half_size = (self.limits.max_message_size - overhead) // 2
|
||||
half_size = (self.limits.max_messages_post_size - overhead) // 2
|
||||
doc = doc.format(helpers.generate_random_string(half_size),
|
||||
helpers.generate_random_string(half_size + offset))
|
||||
|
||||
@ -408,7 +408,7 @@ class TestMessages(base.V1_1FunctionalTestBase):
|
||||
doc = '[{{"body": "{0}", "ttl": 300}}, {{"body": "{1}", "ttl": 120}}]'
|
||||
overhead = len(doc.format('', ''))
|
||||
|
||||
half_size = (self.limits.max_message_size - overhead) // 2
|
||||
half_size = (self.limits.max_messages_post_size - overhead) // 2
|
||||
doc = doc.format(helpers.generate_random_string(half_size),
|
||||
helpers.generate_random_string(half_size + 1))
|
||||
|
||||
|
@ -39,9 +39,10 @@ _TRANSPORT_LIMITS_OPTIONS = (
|
||||
cfg.IntOpt('max_queue_metadata', default=64 * 1024,
|
||||
deprecated_name='metadata_size_uplimit',
|
||||
deprecated_group='limits:transport'),
|
||||
cfg.IntOpt('max_message_size', default=256 * 1024,
|
||||
cfg.IntOpt('max_messages_post_size', default=256 * 1024,
|
||||
deprecated_name='message_size_uplimit',
|
||||
deprecated_group='limits:transport'),
|
||||
deprecated_group='limits:transport',
|
||||
deprecated_opts=[cfg.DeprecatedOpt('max_message_size')]),
|
||||
|
||||
cfg.IntOpt('max_message_ttl', default=1209600,
|
||||
deprecated_name='message_ttl_max',
|
||||
@ -153,10 +154,10 @@ class Validator(object):
|
||||
"""
|
||||
if content_length is None:
|
||||
return
|
||||
if content_length > self._limits_conf.max_message_size:
|
||||
if content_length > self._limits_conf.max_messages_post_size:
|
||||
raise ValidationFailed(
|
||||
_(u'Message collection size is too large. Max size {0}'),
|
||||
self._limits_conf.max_message_size)
|
||||
self._limits_conf.max_messages_post_size)
|
||||
|
||||
def message_content(self, message):
|
||||
"""Restrictions on each message."""
|
||||
|
@ -254,7 +254,7 @@ class MessagesBaseTest(base.V1Base):
|
||||
doc = jsonutils.dumps([{'body': "some body", 'ttl': 100}] * 20,
|
||||
indent=4)
|
||||
|
||||
max_len = self.transport_cfg.max_message_size
|
||||
max_len = self.transport_cfg.max_messages_post_size
|
||||
long_doc = doc + (' ' * (max_len - len(doc) + 1))
|
||||
|
||||
self.simulate_post(self.queue_path + '/messages',
|
||||
|
@ -75,13 +75,13 @@ class TestValidation(base.V1Base):
|
||||
self.assertEqual(self.srmock.status, falcon.HTTP_201)
|
||||
|
||||
# Both messages' size are too long
|
||||
max_message_size = 256
|
||||
max_messages_post_size = 256
|
||||
|
||||
obj = {'a': 0, 'b': ''}
|
||||
envelope_length = len(json.dumps(obj, separators=(',', ':')))
|
||||
obj['b'] = 'x' * (max_message_size - envelope_length + 1)
|
||||
obj['b'] = 'x' * (max_messages_post_size - envelope_length + 1)
|
||||
|
||||
for long_body in ('a' * (max_message_size - 2 + 1), obj):
|
||||
for long_body in ('a' * (max_messages_post_size - 2 + 1), obj):
|
||||
doc = json.dumps([{'body': long_body, 'ttl': 100}])
|
||||
self.simulate_post(self.queue_path + '/messages',
|
||||
self.project_id,
|
||||
|
@ -278,7 +278,7 @@ class MessagesBaseTest(base.V1_1Base):
|
||||
doc = {'messages': [{'body': "some body", 'ttl': 100}] * 20}
|
||||
body = jsonutils.dumps(doc, indent=4)
|
||||
|
||||
max_len = self.transport_cfg.max_message_size
|
||||
max_len = self.transport_cfg.max_messages_post_size
|
||||
long_body = body + (' ' * (max_len - len(body) + 1))
|
||||
|
||||
self.simulate_post(self.queue_path + '/messages',
|
||||
|
@ -75,13 +75,13 @@ class TestValidation(base.V1_1Base):
|
||||
self.assertEqual(self.srmock.status, falcon.HTTP_201)
|
||||
|
||||
# Both messages' size are too long
|
||||
max_message_size = 256
|
||||
max_messages_post_size = 256
|
||||
|
||||
obj = {'a': 0, 'b': ''}
|
||||
envelope_length = len(json.dumps(obj, separators=(',', ':')))
|
||||
obj['b'] = 'x' * (max_message_size - envelope_length + 1)
|
||||
obj['b'] = 'x' * (max_messages_post_size - envelope_length + 1)
|
||||
|
||||
for long_body in ('a' * (max_message_size - 2 + 1), obj):
|
||||
for long_body in ('a' * (max_messages_post_size - 2 + 1), obj):
|
||||
doc = json.dumps([{'body': long_body, 'ttl': 100}])
|
||||
self.simulate_post(self.queue_path + '/messages',
|
||||
self.project_id,
|
||||
|
Loading…
Reference in New Issue
Block a user