Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix grpc crash #595

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class HomestoreConan(ConanFile):
name = "homestore"
version = "6.5.16"
version = "6.5.17"

homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
Expand Down
5 changes: 4 additions & 1 deletion src/lib/replication/repl_dev/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,18 @@ bool repl_req_ctx::add_state_if_not_already(repl_req_state_t s) {
void repl_req_ctx::clear() {
m_header = sisl::blob{};
m_key = sisl::blob{};
release_data();
m_pkts.clear();
}

// FIXME: Use lock to avoid concurrent release of data.
void repl_req_ctx::release_data() {
m_data = nullptr;
// explicitly clear m_buf_for_unaligned_data as unaligned pushdata/fetchdata will be saved here
m_buf_for_unaligned_data = sisl::io_blob_safe{};
if (m_pushed_data) {
LOGTRACEMOD(replication, "m_pushed_data addr={}, m_rkey={}, m_lsn={}",
static_cast<void *>(m_pushed_data.get()),
m_rkey.to_string(), m_lsn);
m_pushed_data->send_response();
m_pushed_data = nullptr;
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/replication/repl_dev/raft_repl_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,9 @@ void RaftReplDev::on_push_data_received(intrusive< sisl::GenericRpcData >& rpc_d
RD_DBG_ASSERT(false, "Error in writing data, error_code={}", err.value());
handle_error(rreq, ReplServiceError::DRIVE_WRITE_ERROR);
} else {
rreq->release_data();
rreq->add_state(repl_req_state_t::DATA_WRITTEN);
rreq->m_data_written_promise.setValue();
rreq->release_data();
const auto data_log_diff_us =
push_data_rcv_time.time_since_epoch().count() > rreq->created_time().time_since_epoch().count()
? get_elapsed_time_us(rreq->created_time(), push_data_rcv_time)
Expand Down Expand Up @@ -872,9 +872,9 @@ void RaftReplDev::handle_fetch_data_response(sisl::GenericClientResponse respons

RD_REL_ASSERT(!err,
"Error in writing data"); // TODO: Find a way to return error to the Listener
rreq->release_data();
rreq->add_state(repl_req_state_t::DATA_WRITTEN);
rreq->m_data_written_promise.setValue();
rreq->release_data();

RD_LOGD("Data Channel: Data Write completed rreq=[{}], data_write_latency_us={}, "
"total_write_latency_us={}, write_num_pieces={}",
Expand Down
Loading