Merge "obj: Include timeout value when logging long-running rsyncs"
This commit is contained in:
commit
1a373991ea
@ -385,7 +385,8 @@ class ObjectReplicator(Daemon):
|
||||
except Timeout:
|
||||
self.logger.error(
|
||||
self._limit_rsync_log(
|
||||
_("Killing long-running rsync: %s") % str(args)))
|
||||
_("Killing long-running rsync after %ds: %s") % (
|
||||
self.rsync_timeout, str(args))))
|
||||
if proc:
|
||||
proc.kill()
|
||||
try:
|
||||
|
@ -2147,7 +2147,7 @@ class TestObjectReplicator(unittest.TestCase):
|
||||
mock_http_connect(200)), \
|
||||
mock.patch.object(self.replicator, 'rsync_timeout', 0.01), \
|
||||
mock.patch('eventlet.green.subprocess.Popen', new_mock):
|
||||
self.replicator.rsync_error_log_line_length = 20
|
||||
self.replicator.rsync_error_log_line_length = 40
|
||||
self.replicator.run_once()
|
||||
for proc in mock_procs:
|
||||
self.assertEqual(proc._calls, [
|
||||
@ -2158,8 +2158,8 @@ class TestObjectReplicator(unittest.TestCase):
|
||||
self.assertEqual(len(mock_procs), 2)
|
||||
error_lines = self.replicator.logger.get_lines_for_level('error')
|
||||
# verify logs are truncated to rsync_error_log_line_length
|
||||
self.assertEqual('Killing long-running', error_lines[0])
|
||||
self.assertEqual('Killing long-running', error_lines[1])
|
||||
self.assertEqual(["Killing long-running rsync after 0s: ['r"] * 2,
|
||||
error_lines)
|
||||
|
||||
def test_replicate_rsync_timeout_wedged(self):
|
||||
cur_part = '0'
|
||||
|
Loading…
Reference in New Issue
Block a user