diff --git a/CHANGELOG.md b/CHANGELOG.md index ddfaf36b..0f01acdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,14 @@ change warranting a new major release: # [v1.29.1] +## Fixed + +- Limit number of handled messages for core TM handlers: + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/391 + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/390 + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/389 +- HeaterHandler better handling for faulty message reception + Issue: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/388 - Disable stopwatch in MAX31865 polling task # [v1.29.0] diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 0b495d53..2cde7f1e 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -108,6 +108,7 @@ void HeaterHandler::readCommandQueue() { break; } else if (result != returnvalue::OK) { sif::warning << "HeaterHandler::readCommandQueue: Message reception error" << std::endl; + break; } result = actionHelper.handleActionMessage(&command); if (result == returnvalue::OK) { diff --git a/mission/tmtc/CfdpTmFunnel.cpp b/mission/tmtc/CfdpTmFunnel.cpp index 0ad6512c..779e9aa8 100644 --- a/mission/tmtc/CfdpTmFunnel.cpp +++ b/mission/tmtc/CfdpTmFunnel.cpp @@ -12,6 +12,7 @@ const char* CfdpTmFunnel::getName() const { return "CFDP TM Funnel"; } ReturnValue_t CfdpTmFunnel::performOperation(uint8_t) { TmTcMessage currentMessage; + unsigned int count = 0; ReturnValue_t status = tmQueue->receiveMessage(¤tMessage); while (status == returnvalue::OK) { status = handlePacket(currentMessage); @@ -19,6 +20,11 @@ ReturnValue_t CfdpTmFunnel::performOperation(uint8_t) { sif::warning << "CfdpTmFunnel packet handling failed" << std::endl; break; } + count++; + if(count == 500) { + sif::error << "CfdpTmFunnel: Possible message storm detected" << std::endl; + break; + } status = tmQueue->receiveMessage(¤tMessage); } diff --git a/mission/tmtc/PusTmFunnel.cpp b/mission/tmtc/PusTmFunnel.cpp index dda854a6..e239afc9 100644 --- a/mission/tmtc/PusTmFunnel.cpp +++ b/mission/tmtc/PusTmFunnel.cpp @@ -12,6 +12,7 @@ PusTmFunnel::~PusTmFunnel() = default; ReturnValue_t PusTmFunnel::performOperation(uint8_t) { TmTcMessage currentMessage; + unsigned int count = 0; ReturnValue_t status = tmQueue->receiveMessage(¤tMessage); while (status == returnvalue::OK) { status = handlePacket(currentMessage); @@ -19,6 +20,11 @@ ReturnValue_t PusTmFunnel::performOperation(uint8_t) { sif::warning << "TmFunnel packet handling failed" << std::endl; break; } + count++; + if(count == 500) { + sif::error << "PusTmFunnel: Possible message storm detected" << std::endl; + break; + } status = tmQueue->receiveMessage(¤tMessage); } diff --git a/mission/tmtc/VirtualChannel.cpp b/mission/tmtc/VirtualChannel.cpp index b0f9391d..64c7b006 100644 --- a/mission/tmtc/VirtualChannel.cpp +++ b/mission/tmtc/VirtualChannel.cpp @@ -28,6 +28,7 @@ ReturnValue_t VirtualChannel::performOperation() { ReturnValue_t result = returnvalue::OK; TmTcMessage message; + unsigned int count = 0; while (tmQueue->receiveMessage(&message) == returnvalue::OK) { store_address_t storeId = message.getStorageId(); const uint8_t* data = nullptr; @@ -43,12 +44,16 @@ ReturnValue_t VirtualChannel::performOperation() { if (linkIsUp) { result = ptme->writeToVc(vcId, data, size); } - tmStore->deleteData(storeId); - if (result != returnvalue::OK) { return result; } + + count++; + if(count == 500) { + sif::error << "VirtualChannel: Possible message storm detected" << std::endl; + break; + } } return result; }