Skip to content

Commit

Permalink
[core] fix bug that processes will not be "unregistered" correctly. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
KerstinKeller authored Oct 8, 2024
1 parent 974964f commit cd7f327
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ecal/core/src/registration/ecal_process_registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ eCAL::Registration::Sample eCAL::Registration::GetProcessRegisterSample()
auto& process_sample_identifier = process_sample.identifier;
process_sample_identifier.host_name = eCAL::Process::GetHostName();
process_sample_identifier.process_id = eCAL::Process::GetProcessID();
// We need to set the pid as entity_id.
// However, we cannot send anything over the wire :(
process_sample_identifier.entity_id = std::to_string(process_sample_identifier.process_id);

auto& process_sample_process = process_sample.process;
process_sample_process.hgname = eCAL::Process::GetHostGroupName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,8 @@ namespace
registration_.process.rclock = pb_sample_.process.rclock;
// pid
registration_.identifier.process_id = pb_sample_.process.pid;
// tid -> we need to use the PID here, because we don't have a designated field for it
registration_.identifier.entity_id = std::to_string(registration_.identifier.process_id);
// state.severity
registration_.process.state.severity = static_cast<eCAL::Registration::eProcessSeverity>(pb_sample_.process.state.severity);
// state.severity_level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ namespace eCAL
sample.host.hname = GenerateString(8);
sample.identifier = GenerateIdentifier();
// Process samples don't have an id internally, hence it must be 0.
sample.identifier.entity_id = "";
sample.identifier.entity_id = std::to_string(sample.identifier.process_id);
sample.process = GenerateProcess();
return sample;
}
Expand Down

0 comments on commit cd7f327

Please sign in to comment.