Skip to content

Commit 77e87bb

Browse files
chengyu-lliuchengyu
and
liuchengyu
authored
fix: duplicate closing files(OpenAtomFoundation#2304) (OpenAtomFoundation#2311)
Co-authored-by: liuchengyu <[email protected]>
1 parent ae5e8c6 commit 77e87bb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/rsync_client.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Status RsyncClient::CopyRemoteFile(const std::string& filename, int index) {
166166
while (retries < max_retries_) {
167167
if (state_.load() != RUNNING) {
168168
break;
169-
}
169+
}
170170
size_t copy_file_begin_time = pstd::NowMicros();
171171
size_t count = Throttle::GetInstance().ThrottledByThroughput(kBytesPerRequest);
172172
if (count == 0) {
@@ -227,12 +227,7 @@ Status RsyncClient::CopyRemoteFile(const std::string& filename, int index) {
227227
s = writer->Fsync();
228228
if (!s.ok()) {
229229
return s;
230-
}
231-
s = writer->Close();
232-
if (!s.ok()) {
233-
return s;
234-
}
235-
writer.reset();
230+
}
236231
mu_.lock();
237232
meta_table_[filename] = "";
238233
mu_.unlock();

0 commit comments

Comments
 (0)