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:
parent
4137326378
commit
a61d154fa3
@ -1312,7 +1312,7 @@ class GetOrHeadHandler(object):
|
||||
_('Trying to read during GET'))
|
||||
raise
|
||||
except ChunkWriteTimeout:
|
||||
self.app.logger.warning(
|
||||
self.app.logger.info(
|
||||
_('Client did not read from proxy within %ss') %
|
||||
self.app.client_timeout)
|
||||
self.app.logger.increment('client_timeouts')
|
||||
@ -1327,8 +1327,8 @@ class GetOrHeadHandler(object):
|
||||
if end - begin + 1 == self.bytes_used_from_backend:
|
||||
warn = False
|
||||
if not req.environ.get('swift.non_client_disconnect') and warn:
|
||||
self.app.logger.warning('Client disconnected on read of %r',
|
||||
self.path)
|
||||
self.app.logger.info('Client disconnected on read of %r',
|
||||
self.path)
|
||||
raise
|
||||
except Exception:
|
||||
self.app.logger.exception(_('Trying to send to client'))
|
||||
|
@ -1243,7 +1243,7 @@ class TestFuncs(BaseTest):
|
||||
client_chunks = list(app_iter)
|
||||
self.assertEqual(client_chunks, [b'abcd1234', b'efgh5678'])
|
||||
|
||||
def test_disconnected_warning(self):
|
||||
def test_disconnected_logging(self):
|
||||
self.app.logger = mock.Mock()
|
||||
req = Request.blank('/v1/a/c/o')
|
||||
|
||||
@ -1270,7 +1270,7 @@ class TestFuncs(BaseTest):
|
||||
'some-path', {})
|
||||
app_iter = handler._make_app_iter(req, node, source)
|
||||
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')
|
||||
|
||||
self.app.logger = mock.Mock()
|
||||
|
Loading…
x
Reference in New Issue
Block a user