Add registry_client_timeout parameter
Add a "registry_client_timeout" parameter which specifies the time, in seconds, that an API server will wait for a registry request to complete. This prevents API clients hanging indefinitely in the event that the registry becomes unresponsive. Addresses LP bug 1089391. Change-Id: Ib27b6eecdcb65cbe644c156a0ca5cd0d0b4638dd
This commit is contained in:
parent
7324ffd4c5
commit
a12f09fa96
@ -235,6 +235,14 @@ When using SSL in connections to the registry server, do not require
|
||||
validation via a certifying authority. This is the registry's equivalent of
|
||||
specifying --insecure on the command line using glanceclient for the API
|
||||
|
||||
* ``registry_client_timeout=SECONDS``
|
||||
|
||||
Optional. Default: ``600``.
|
||||
|
||||
The period of time, in seconds, that the API server will wait for a registry
|
||||
request to complete. A value of '0' implies no timeout.
|
||||
|
||||
|
||||
Configuring Logging in Glance
|
||||
-----------------------------
|
||||
|
||||
|
@ -137,6 +137,11 @@ registry_client_protocol = http
|
||||
# Default: False
|
||||
#registry_client_insecure = False
|
||||
|
||||
# The period of time, in seconds, that the API server will wait for a registry
|
||||
# request to complete. A value of '0' implies no timeout.
|
||||
# Default: 600
|
||||
#registry_client_timeout = 600
|
||||
|
||||
# ============ Notification System Options =====================
|
||||
|
||||
# Notifications can be sent when images are create, updated or deleted.
|
||||
|
@ -197,6 +197,9 @@ class BaseClient(object):
|
||||
self.host = host
|
||||
self.port = port or self.DEFAULT_PORT
|
||||
self.timeout = timeout
|
||||
# A value of '0' implies never timeout
|
||||
if timeout == 0:
|
||||
self.timeout = None
|
||||
self.use_ssl = use_ssl
|
||||
self.auth_tok = auth_tok
|
||||
self.creds = creds or {}
|
||||
|
@ -38,6 +38,7 @@ registry_client_opts = [
|
||||
cfg.StrOpt('registry_client_cert_file'),
|
||||
cfg.StrOpt('registry_client_ca_file'),
|
||||
cfg.BoolOpt('registry_client_insecure', default=False),
|
||||
cfg.IntOpt('registry_client_timeout', default=600),
|
||||
cfg.StrOpt('metadata_encryption_key', secret=True),
|
||||
]
|
||||
registry_client_ctx_opts = [
|
||||
@ -87,6 +88,7 @@ def configure_registry_client():
|
||||
'cert_file': CONF.registry_client_cert_file,
|
||||
'ca_file': CONF.registry_client_ca_file,
|
||||
'insecure': CONF.registry_client_insecure,
|
||||
'timeout': CONF.registry_client_timeout,
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user