Skip to content

Commit

Permalink
Merge pull request #364 from holmes1412/master
Browse files Browse the repository at this point in the history
Fix : call RPCModule::server_task_end() after serialize_meta()
  • Loading branch information
Barenboim authored Mar 7, 2024
2 parents fd44a0a + c186696 commit 8b382c5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/module/rpc_metrics_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ void RPCMetricsOTel::Collector::collect_counter_each(const std::string& label,

if (!label.empty())
{
it = this->label_map.find(label);
if (it == this->label_map.end())
{
this->add_counter_label(label);
Expand Down
2 changes: 1 addition & 1 deletion src/module/rpc_trace_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ bool RPCTraceModule<STASK, CTASK>::server_end(SubTask *task,
return true;
}

TraceModule::client_end_response(resp, data);
TraceModule::server_end_response(resp, data);

return true;
}
Expand Down
16 changes: 8 additions & 8 deletions src/rpc_task.inl
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,6 @@ CommMessageOut *RPCServerTask<RPCREQ, RPCRESP>::message_out()
if (status_code == RPCStatusOK)
status_code = this->resp.compress();

// for server, this is the where series->module_data stored
RPCModuleData *data = this->mutable_module_data();

for (auto *module : modules_)
module->server_task_end(this, *data);

this->resp.set_meta_module_data(*data);

if (status_code == RPCStatusOK)
{
if (!this->resp.serialize_meta())
Expand All @@ -309,6 +301,14 @@ CommMessageOut *RPCServerTask<RPCREQ, RPCRESP>::message_out()
if (this->resp.get_status_code() == RPCStatusOK)
this->resp.set_status_code(status_code);

// for server, this is the where series->module_data stored
RPCModuleData *data = this->mutable_module_data();

for (auto *module : modules_)
module->server_task_end(this, *data);

this->resp.set_meta_module_data(*data);

if (status_code == RPCStatusOK)
return this->WFServerTask<RPCREQ, RPCRESP>::message_out();

Expand Down
1 change: 1 addition & 0 deletions tools/templates/config/config_full.cc
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ void RPCConfig::load_trace()
report_interval = it["report_interval_ms"];

auto *filter = new RPCTraceOpenTelemetry(url,
OTLP_TRACES_PATH,
redirect_max,
retry_max,
spans_per_second,
Expand Down

0 comments on commit 8b382c5

Please sign in to comment.