Browse Source

Raise the default max header to accommodate large tokens

PKI tokens hit the default limit if there is enough
services defined in the keystone catalog.

So sahara should allow users to customize max header size and
also increase the default value from 8192 to 16384.

Change-Id: If3daff1ba18f7fcd4cf3b7d9b4152b551d8ad277
Closes-Bug: 1190149
changes/83/166083/2
Deliang Fan 7 years ago
parent
commit
07dc4fd895
  1. 4
      sahara/config.py
  2. 12
      sahara/utils/wsgi.py

4
sahara/config.py

@ -133,6 +133,7 @@ def list_opts():
from sahara.utils.openstack import nova
from sahara.utils.openstack import swift
from sahara.utils import proxy
from sahara.utils import wsgi
return [
(None,
@ -150,7 +151,8 @@ def list_opts():
periodic.periodic_opts,
volumes.opts,
proxy.opts,
cpo.event_log_opts)),
cpo.event_log_opts,
wsgi.wsgi_opts)),
(api.conductor_group.name,
itertools.chain(api.conductor_opts)),
(cinder.cinder_group.name,

12
sahara/utils/wsgi.py

@ -42,7 +42,18 @@ from sahara.i18n import _LI
from sahara.openstack.common import sslutils
LOG = logging.getLogger(__name__)
wsgi_opts = [
cfg.IntOpt('max_header_line',
default=16384,
help="Maximum line size of message headers to be accepted. "
"max_header_line may need to be increased when using "
"large tokens (typically those generated by the "
"Keystone v3 API with big service catalogs)."),
]
CONF = cfg.CONF
CONF.register_opts(wsgi_opts)
class ProtectedExpatParser(expatreader.ExpatParser):
@ -328,6 +339,7 @@ class Server(object):
"""Server class to manage multiple WSGI sockets and applications."""
def __init__(self, threads=500):
eventlet.wsgi.MAX_HEADER_LINE = CONF.max_header_line
self.threads = threads
self.children = []
self.running = True

Loading…
Cancel
Save