Skip to content

SHM Buffer recovery mechanishm <1.10.x> [8220] #1159

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

Merged
merged 7 commits into from
Apr 21, 2020
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
17 changes: 13 additions & 4 deletions src/cpp/rtps/transport/shared_mem/SharedMemGlobal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ class SharedMemGlobal
*/
struct BufferDescriptor
{
alignas(8) uint32_t flags;
uint64_t enqueue_tick;
SharedMemSegment::Id source_segment_id;
SharedMemSegment::Offset buffer_node_offset;
uint32_t validity_id;
};

typedef MultiProducerConsumerRingBuffer<BufferDescriptor>::Listener Listener;
Expand Down Expand Up @@ -358,7 +357,7 @@ class SharedMemGlobal
(*port_it)->node->is_port_ok = false;

logWarning(RTPS_TRANSPORT_SHM, "Port " << (*port_it)->node->port_id
<< " error: " << e.what());
<< ": " << e.what());

// Remove the port from watch
port_it = watched_ports_.erase(port_it);
Expand Down Expand Up @@ -791,7 +790,7 @@ class SharedMemGlobal
}

try
{
{
port->healthy_check();

if ( (port_node->is_opened_read_exclusive && open_mode != Port::OpenMode::Write) ||
Expand Down Expand Up @@ -867,6 +866,16 @@ class SharedMemGlobal
return port;
}

/**
* Remove a port from the system.
*/
void remove_port(
uint32_t port_id)
{
auto port_segment_name = domain_name_ + "_port" + std::to_string(port_id);
SharedMemSegment::remove(port_segment_name.c_str());
}

private:

std::string domain_name_;
Expand Down
Loading