Skip to content

Commit

Permalink
fix: duplicate closing files(OpenAtomFoundation#2304) (OpenAtomFounda…
Browse files Browse the repository at this point in the history
…tion#2311)

Co-authored-by: liuchengyu <liuchengyu@360.cn>
  • Loading branch information
chengyu-l and liuchengyu authored Jan 15, 2024
1 parent bf08a8f commit 73dbcd6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/rsync_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Status RsyncClient::CopyRemoteFile(const std::string& filename, int index) {
while (retries < max_retries_) {
if (state_.load() != RUNNING) {
break;
}
}
size_t copy_file_begin_time = pstd::NowMicros();
size_t count = Throttle::GetInstance().ThrottledByThroughput(kBytesPerRequest);
if (count == 0) {
Expand Down Expand Up @@ -227,12 +227,7 @@ Status RsyncClient::CopyRemoteFile(const std::string& filename, int index) {
s = writer->Fsync();
if (!s.ok()) {
return s;
}
s = writer->Close();
if (!s.ok()) {
return s;
}
writer.reset();
}
mu_.lock();
meta_table_[filename] = "";
mu_.unlock();
Expand Down

0 comments on commit 73dbcd6

Please sign in to comment.