diff --git a/iceoryx_posh/source/roudi/port_manager.cpp b/iceoryx_posh/source/roudi/port_manager.cpp index 50d92ee673..e887aed564 100644 --- a/iceoryx_posh/source/roudi/port_manager.cpp +++ b/iceoryx_posh/source/roudi/port_manager.cpp @@ -164,7 +164,9 @@ void PortManager::doDiscoveryForPublisherPort(PublisherPortRouDiType& publisherP } else { - // protocol error + LogWarn() << "CaPro protocol error for publisher from runtime '" << publisherPort.getRuntimeName() + << "' and with service description '" << publisherPort.getCaProServiceDescription() + << "'! Cannot handle CaProMessageType '" << caproMessage.m_type << "'"; errorHandler( Error::kPORT_MANAGER__HANDLE_PUBLISHER_PORTS_INVALID_CAPRO_MESSAGE, nullptr, iox::ErrorLevel::MODERATE); } @@ -201,7 +203,9 @@ void PortManager::doDiscoveryForSubscriberPort(SubscriberPortType& subscriberPor m_portIntrospection.reportMessage(caproMessage, subscriberPort.getUniqueID()); if (!this->sendToAllMatchingPublisherPorts(caproMessage, subscriberPort)) { - LogDebug() << "capro::SUB/UNSUB, no matching publisher!!"; + LogDebug() << "capro::SUB/UNSUB, no matching publisher for subscriber from runtime '" + << subscriberPort.getRuntimeName() << "' and with service description '" + << caproMessage.m_serviceDescription << "'!"; capro::CaproMessage nackMessage(capro::CaproMessageType::NACK, subscriberPort.getCaProServiceDescription()); auto returnMessage = subscriberPort.dispatchCaProMessageAndGetPossibleResponse(nackMessage); @@ -211,7 +215,9 @@ void PortManager::doDiscoveryForSubscriberPort(SubscriberPortType& subscriberPor } else { - // protocol error + LogWarn() << "CaPro protocol error for subscriber from runtime '" << subscriberPort.getRuntimeName() + << "' and with service description '" << subscriberPort.getCaProServiceDescription() + << "'! Cannot handle CaProMessageType '" << caproMessage.m_type << "'"; errorHandler(Error::kPORT_MANAGER__HANDLE_SUBSCRIBER_PORTS_INVALID_CAPRO_MESSAGE, nullptr, iox::ErrorLevel::MODERATE); @@ -240,10 +246,11 @@ void PortManager::destroyClientPort(popo::ClientPortData* const clientPortData) /// @todo iox-#27 report to port introspection + LogDebug() << "Destroy client port from runtime '" << clientPortData->m_runtimeName + << "' and with service description '" << clientPortData->m_serviceDescription << "'"; + // delete client port from list after DISCONNECT was processed m_portPool->removeClientPort(clientPortData); - - LogDebug() << "Destroyed client port"; } void PortManager::handleClientPorts() noexcept @@ -272,7 +279,9 @@ void PortManager::doDiscoveryForClientPort(popo::ClientPortRouDi& clientPort) no /// @todo iox-#27 report to port introspection if (!this->sendToAllMatchingServerPorts(caproMessage, clientPort)) { - LogDebug() << "capro::CONNECT/DISCONNECT, no matching server!!"; + LogDebug() << "capro::CONNECT/DISCONNECT, no matching server for client from runtime '" + << clientPort.getRuntimeName() << "' and with service description '" + << caproMessage.m_serviceDescription << "'!"; capro::CaproMessage nackMessage(capro::CaproMessageType::NACK, clientPort.getCaProServiceDescription()); auto returnMessage = clientPort.dispatchCaProMessageAndGetPossibleResponse(nackMessage); // No response on NACK messages @@ -281,7 +290,9 @@ void PortManager::doDiscoveryForClientPort(popo::ClientPortRouDi& clientPort) no } else { - // protocol error + LogWarn() << "CaPro protocol error for client from runtime '" << clientPort.getRuntimeName() + << "' and with service description '" << clientPort.getCaProServiceDescription() + << "'! Cannot handle CaProMessageType '" << caproMessage.m_type << "'"; errorHandler( Error::kPORT_MANAGER__HANDLE_CLIENT_PORTS_INVALID_CAPRO_MESSAGE, nullptr, iox::ErrorLevel::MODERATE); } @@ -324,10 +335,11 @@ void PortManager::destroyServerPort(popo::ServerPortData* const serverPortData) /// @todo iox-#27 report to port introspection + LogDebug() << "Destroy server port from runtime '" << serverPortData->m_runtimeName + << "' and with service description '" << serverPortData->m_serviceDescription << "'"; + // delete server port from list after STOP_OFFER was processed m_portPool->removeServerPort(serverPortData); - - LogDebug() << "Destroyed server port"; } void PortManager::handleServerPorts() noexcept @@ -362,7 +374,9 @@ void PortManager::doDiscoveryForServerPort(popo::ServerPortRouDi& serverPort) no } else { - // protocol error + LogWarn() << "CaPro protocol error for server from runtime '" << serverPort.getRuntimeName() + << "' and with service description '" << serverPort.getCaProServiceDescription() + << "'! Cannot handle CaProMessageType '" << caproMessage.m_type << "'"; errorHandler( Error::kPORT_MANAGER__HANDLE_SERVER_PORTS_INVALID_CAPRO_MESSAGE, nullptr, iox::ErrorLevel::MODERATE); } @@ -389,8 +403,9 @@ void PortManager::handleInterfaces() noexcept // check if we have to destroy this interface port if (interfacePortData->m_toBeDestroyed.load(std::memory_order_relaxed)) { + LogDebug() << "Destroy interface port from runtime '" << interfacePortData->m_runtimeName + << "' and with service description '" << interfacePortData->m_serviceDescription << "'"; m_portPool->removeInterfacePort(interfacePortData); - LogDebug() << "Destroyed InterfacePortData"; } } @@ -447,8 +462,9 @@ void PortManager::handleNodes() noexcept { if (nodeData->m_toBeDestroyed.load(std::memory_order_relaxed)) { + LogDebug() << "Destroy NodeData from runtime '" << nodeData->m_runtimeName << "' and node name '" + << nodeData->m_nodeName << "'"; m_portPool->removeNodeData(nodeData); - LogDebug() << "Destroyed NodeData"; } } } @@ -459,8 +475,8 @@ void PortManager::handleConditionVariables() noexcept { if (conditionVariableData->m_toBeDestroyed.load(std::memory_order_relaxed)) { + LogDebug() << "Destroy ConditionVariableData from runtime '" << conditionVariableData->m_runtimeName << "'"; m_portPool->removeConditionVariableData(conditionVariableData); - LogDebug() << "Destroyed ConditionVariableData"; } } } @@ -782,10 +798,10 @@ void PortManager::destroyPublisherPort(PublisherPortRouDiType::MemberType_t* con m_portIntrospection.removePublisher(publisherPortUser); + LogDebug() << "Destroy publisher port from runtime '" << publisherPortData->m_runtimeName + << "' and with service description '" << publisherPortData->m_serviceDescription << "'"; // delete publisher port from list after STOP_OFFER was processed m_portPool->removePublisherPort(publisherPortData); - - LogDebug() << "Destroyed publisher port"; } void PortManager::destroySubscriberPort(SubscriberPortType::MemberType_t* const subscriberPortData) noexcept @@ -806,10 +822,11 @@ void PortManager::destroySubscriberPort(SubscriberPortType::MemberType_t* const }); m_portIntrospection.removeSubscriber(subscriberPortUser); + + LogDebug() << "Destroy subscriber port from runtime '" << subscriberPortData->m_runtimeName + << "' and with service description '" << subscriberPortData->m_serviceDescription << "'"; // delete subscriber port from list after UNSUB was processed m_portPool->removeSubscriberPort(subscriberPortData); - - LogDebug() << "Destroyed subscriber port"; } runtime::IpcMessage PortManager::findService(const cxx::optional& service, diff --git a/iceoryx_posh/source/roudi/port_pool.cpp b/iceoryx_posh/source/roudi/port_pool.cpp index 70970d7758..9ba5ef028f 100644 --- a/iceoryx_posh/source/roudi/port_pool.cpp +++ b/iceoryx_posh/source/roudi/port_pool.cpp @@ -54,6 +54,7 @@ PortPool::addInterfacePort(const RuntimeName_t& runtimeName, const capro::Interf } else { + LogWarn() << "Out of interface ports! Requested by runtime '" << runtimeName << "'"; errorHandler(Error::kPORT_POOL__INTERFACELIST_OVERFLOW, nullptr, ErrorLevel::MODERATE); return cxx::error(PortPoolError::INTERFACE_PORT_LIST_FULL); } @@ -70,6 +71,8 @@ cxx::expected PortPool::addNodeData(const Run } else { + LogWarn() << "Out of node data! Requested by runtime '" << runtimeName << "' and node name '" << nodeName + << "'"; errorHandler(Error::kPORT_POOL__NODELIST_OVERFLOW, nullptr, ErrorLevel::MODERATE); return cxx::error(PortPoolError::NODE_DATA_LIST_FULL); } @@ -85,6 +88,7 @@ PortPool::addConditionVariableData(const RuntimeName_t& runtimeName) noexcept } else { + LogWarn() << "Out of condition variables! Requested by runtime '" << runtimeName << "'"; errorHandler(Error::kPORT_POOL__CONDITION_VARIABLE_LIST_OVERFLOW, nullptr, ErrorLevel::MODERATE); return cxx::error(PortPoolError::CONDITION_VARIABLE_LIST_FULL); } @@ -135,6 +139,8 @@ PortPool::addPublisherPort(const capro::ServiceDescription& serviceDescription, } else { + LogWarn() << "Out of publisher ports! Requested by runtime '" << runtimeName + << "' and with service description '" << serviceDescription << "'"; errorHandler(Error::kPORT_POOL__PUBLISHERLIST_OVERFLOW, nullptr, ErrorLevel::MODERATE); return cxx::error(PortPoolError::PUBLISHER_PORT_LIST_FULL); } @@ -155,6 +161,8 @@ PortPool::addSubscriberPort(const capro::ServiceDescription& serviceDescription, } else { + LogWarn() << "Out of subscriber ports! Requested by runtime '" << runtimeName + << "' and with service description '" << serviceDescription << "'"; errorHandler(Error::kPORT_POOL__SUBSCRIBERLIST_OVERFLOW, nullptr, ErrorLevel::MODERATE); return cxx::error(PortPoolError::SUBSCRIBER_PORT_LIST_FULL); } @@ -179,6 +187,8 @@ PortPool::addClientPort(const capro::ServiceDescription& serviceDescription, { if (!m_portPoolData->m_clientPortMembers.hasFreeSpace()) { + LogWarn() << "Out of client ports! Requested by runtime '" << runtimeName << "' and with service description '" + << serviceDescription << "'"; errorHandler(Error::kPORT_POOL__CLIENTLIST_OVERFLOW, nullptr, ErrorLevel::MODERATE); return cxx::error(PortPoolError::CLIENT_PORT_LIST_FULL); } @@ -197,6 +207,8 @@ PortPool::addServerPort(const capro::ServiceDescription& serviceDescription, { if (!m_portPoolData->m_serverPortMembers.hasFreeSpace()) { + LogWarn() << "Out of server ports! Requested by runtime '" << runtimeName << "' and with service description '" + << serviceDescription << "'"; errorHandler(Error::kPORT_POOL__SERVERLIST_OVERFLOW, nullptr, ErrorLevel::MODERATE); return cxx::error(PortPoolError::SERVER_PORT_LIST_FULL); }