Skip to content

Commit

Permalink
Apply patch from bytedance#359
Browse files Browse the repository at this point in the history
  • Loading branch information
ruipeterpan authored Jan 20, 2021
1 parent 46f7dde commit 350673f
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions byteps/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,19 @@ void SendPushResponse(uint64_t key, const ps::KVMeta& req,
void SendPullResponse(const DataHandleType type, const uint64_t key,
const ps::KVMeta& req_meta, ps::KVServer<char>* server) {
std::lock_guard<std::mutex> lock(pullresp_mu_);
auto& updates = update_buf_[key];
CHECK(updates.merged.tensor) << "init " << key << " first";
char* data = updates.merged.tensor;
auto len = updates.merged.len;
char* data;
size_t len;
if (sync_mode_) {
auto& updates = update_buf_[key];
CHECK(updates.merged.tensor) << "init " << key << " first";
data = updates.merged.tensor;
len = updates.merged.len;
} else {
auto stored = store_.at(key);
CHECK(stored.tensor) << "init " << key << " first";
data = stored.tensor;
len = stored.len;
}

// send pull response
auto iterator = pull_response_map_.find(key);
Expand Down Expand Up @@ -508,7 +517,7 @@ extern "C" void byteps_server() {
free(it.second.tensor);
}
}

LOG(INFO) << "byteps has been shutdown";
return;
}
Expand Down

0 comments on commit 350673f

Please sign in to comment.