proxy: Downgrade some client problems to info
There's no good reason for us to log client behaviors like closed sockets or slow reads at warning -- there's little if anything an operator can do about it. Change-Id: Ic2eabdce4477061e30dca52ad38f562cb6750001
This commit is contained in:
@@ -1312,7 +1312,7 @@ class GetOrHeadHandler(object):
|
|||||||
_('Trying to read during GET'))
|
_('Trying to read during GET'))
|
||||||
raise
|
raise
|
||||||
except ChunkWriteTimeout:
|
except ChunkWriteTimeout:
|
||||||
self.app.logger.warning(
|
self.app.logger.info(
|
||||||
_('Client did not read from proxy within %ss') %
|
_('Client did not read from proxy within %ss') %
|
||||||
self.app.client_timeout)
|
self.app.client_timeout)
|
||||||
self.app.logger.increment('client_timeouts')
|
self.app.logger.increment('client_timeouts')
|
||||||
@@ -1327,8 +1327,8 @@ class GetOrHeadHandler(object):
|
|||||||
if end - begin + 1 == self.bytes_used_from_backend:
|
if end - begin + 1 == self.bytes_used_from_backend:
|
||||||
warn = False
|
warn = False
|
||||||
if not req.environ.get('swift.non_client_disconnect') and warn:
|
if not req.environ.get('swift.non_client_disconnect') and warn:
|
||||||
self.app.logger.warning('Client disconnected on read of %r',
|
self.app.logger.info('Client disconnected on read of %r',
|
||||||
self.path)
|
self.path)
|
||||||
raise
|
raise
|
||||||
except Exception:
|
except Exception:
|
||||||
self.app.logger.exception(_('Trying to send to client'))
|
self.app.logger.exception(_('Trying to send to client'))
|
||||||
|
@@ -1243,7 +1243,7 @@ class TestFuncs(BaseTest):
|
|||||||
client_chunks = list(app_iter)
|
client_chunks = list(app_iter)
|
||||||
self.assertEqual(client_chunks, [b'abcd1234', b'efgh5678'])
|
self.assertEqual(client_chunks, [b'abcd1234', b'efgh5678'])
|
||||||
|
|
||||||
def test_disconnected_warning(self):
|
def test_disconnected_logging(self):
|
||||||
self.app.logger = mock.Mock()
|
self.app.logger = mock.Mock()
|
||||||
req = Request.blank('/v1/a/c/o')
|
req = Request.blank('/v1/a/c/o')
|
||||||
|
|
||||||
@@ -1270,7 +1270,7 @@ class TestFuncs(BaseTest):
|
|||||||
'some-path', {})
|
'some-path', {})
|
||||||
app_iter = handler._make_app_iter(req, node, source)
|
app_iter = handler._make_app_iter(req, node, source)
|
||||||
app_iter.close()
|
app_iter.close()
|
||||||
self.app.logger.warning.assert_called_once_with(
|
self.app.logger.info.assert_called_once_with(
|
||||||
'Client disconnected on read of %r', 'some-path')
|
'Client disconnected on read of %r', 'some-path')
|
||||||
|
|
||||||
self.app.logger = mock.Mock()
|
self.app.logger = mock.Mock()
|
||||||
|
Reference in New Issue
Block a user