Update patch set 2

Patch Set 2:

On all proxy servers there were few of this error at one moment.
It's probably race-condition where multiple threads are creating a new token because
the old one is expired. Multiple POST requests are sent but only the first one
succeed, other requests end up with 409 error.

```
May  5 20:18:39 swift-proxy3 swift-proxy-server: STDOUT: EXCEPTION IN handle: Traceback (most recent call last):#012  File "/usr/lib/python2.7/dist-packages/swauth/middleware.py", line 520, in handle#012    return self.handle_request(req)(env, start_response)#012  File "/usr/lib/python2.7/dist-packages/swauth/middleware.py", line 586, in handle_request#012    req.response = handler(req)#012  File "/usr/lib/python2.7/dist-packages/swauth/middleware.py", line 1420, in handle_get_token#012    (path, resp.status))#012Exception: Could not save new token: /v1/AUTH_.auth/d_25/filtrilon 409 Conflict#012: {'SCRIPT_NAME': '/auth', 'HTTP_X_AUTH_KEY': 'xxxxxxxxxxxxxxxxxxx', 'swift.proxy_access_log_made': True, 'REQUEST_METHOD': 'GET', 'PATH_INFO': '/v1.0', 'SERVER_PROTOCOL': 'HTTP/1.0', 'swift.infocache': {'container/AUTH_.auth/.token_6': {u'status': 204, u'sync_key': None, u'write_acl': None, u'object_count': '20680', u'storage_policy': '0', u'versions': None, u'bytes': '3462706', u'meta': {}, u'cors': {u'allow_origin': None, u'expose_headers': None, u'max_age': None}, u'sysmeta': {}, u'read_acl': None}, 'container/AUTH_.auth/d_25': {'status': 204, 'sync_key': None, 'storage_policy': '0', 'meta': {'account-id': 'AUTH_d_25'}, 'cors': {'allow_origin': None, 'expose_headers': None, 'max_age': None}, 'sysmeta': {}, 'read_acl': None, 'object_count': '6', 'write_acl': None, 'versions': None, 'bytes': '1434'}, 'account/AUTH_.auth': {u'status': 204, u'account_really_exists': True, u'container_count': '130', u'storage_policies': {u'0': {u'object_count': 0, u'container_count': 0, u'bytes': 0}}, u'bytes': '55450421', u'total_object_count': '330795', u'meta': {}, u'sysmeta': {}}}, 'HTTP_X_AUTH_USER': 'd_25:filtrilon', 'HTTP_USER_AGENT': 'python-swiftclient-3.1.0', 'HTTP_CONNECTION': 'close', 'REMOTE_PORT': '44454', 'SERVER_NAME': '127.0.0.1', 'REMOTE_ADDR': '127.0.0.1', 'eventlet.input': <eventlet.wsgi.Input object at 0x7fa10d7a0250>, 'wsgi.url_scheme': 'http', 'SERVER_PORT': '8080', 'CONTENT_TYPE': None, 'wsgi.input': <swift.common.utils.InputProxy object at 0x7fa10d75efd0>, 'HTTP_HOST': '127.0.0.1:8080', 'swift.cache': <swift.common.memcached.MemcacheRing object at 0x7fa10d82b950>, 'wsgi.multithread': True, 'eventlet.posthooks': [(<bound method Swauth.posthooklogger of <swauth.middleware.Swauth object at 0x7fa10e1cdf90>>, (<swift.common.swob.Request object at 0x7fa10d7a0150>,), {})], 'wsgi.version': (1, 0), 'RAW_PATH_INFO': '/auth/v1.0', 'GATEWAY_INTERFACE': 'CGI/1.1', 'wsgi.run_once': False, 'wsgi.errors': <swift.common.utils.LoggerFileObject object at 0x7fa10e141650>, 'wsgi.multiprocess': False, 'swift.trans_id': 'tx27f11b375a7e476f88286-005ccf28ff', 'headers_raw': (('Host', '127.0.0.1:8080'), ('Connection', 'close'), ('Accept-Encoding', 'identity'), ('user-agent', 'python-swiftclient-3.1.0'), ('x-auth-user', 'd_25:filtrilon'), ('x-auth-key', 'xxxxxxxxxxxxxxxxxxxxx')), 'HTTP_ACCEPT_ENCODING': 'identity'}
```

Fix is that after 409 error occurs we try to fetch the current token once again.

Patch-set: 2
Reviewer: Gerrit User 30203 <30203@4a232e18-c5a9-48ee-94c0-e04e7cca6543>
Label: Verified=0
This commit is contained in:
Gerrit User 30203 2019-05-15 12:32:45 +00:00 committed by Gerrit Code Review
parent 1dd161d786
commit 707b196e55

Diff Content Not Available