Merge "Fix incorrect passing of file object to fsync()"
This commit is contained in:
commit
65f28ae105
@ -1786,8 +1786,8 @@ class ECDiskFileWriter(DiskFileWriter):
|
||||
def _finalize_durable(self, durable_file_path):
|
||||
exc = msg = None
|
||||
try:
|
||||
with open(durable_file_path, 'w') as _fd:
|
||||
fsync(_fd)
|
||||
with open(durable_file_path, 'w') as _fp:
|
||||
fsync(_fp.fileno())
|
||||
try:
|
||||
self.manager.hash_cleanup_listdir(self._datadir)
|
||||
except OSError:
|
||||
|
@ -2650,8 +2650,7 @@ class DiskFileMixin(BaseDiskFileTestMixin):
|
||||
}[policy.policy_type]
|
||||
self.assertEqual(expected, mock_fsync.call_count)
|
||||
if policy.policy_type == EC_POLICY:
|
||||
durable_file = '%s.durable' % timestamp.internal
|
||||
self.assertTrue(durable_file in str(mock_fsync.call_args[0]))
|
||||
self.assertTrue(isinstance(mock_fsync.call_args[0][0], int))
|
||||
|
||||
def test_commit_ignores_hash_cleanup_listdir_error(self):
|
||||
for policy in POLICIES:
|
||||
|
Loading…
x
Reference in New Issue
Block a user