From 186a0a083ddb7d3235646ef3fbac7b5af50b0db1 Mon Sep 17 00:00:00 2001 From: Nicolas Herment Date: Wed, 23 Oct 2024 13:11:07 +0200 Subject: [PATCH] fix: issue with OOM not being reported due to being captured downstream --- src/robusta/core/sinks/robusta/robusta_sink.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/robusta/core/sinks/robusta/robusta_sink.py b/src/robusta/core/sinks/robusta/robusta_sink.py index bc0c46de4..2da0efaa5 100644 --- a/src/robusta/core/sinks/robusta/robusta_sink.py +++ b/src/robusta/core/sinks/robusta/robusta_sink.py @@ -331,13 +331,15 @@ def __discover_resources(self) -> DiscoveryResults: except Exception: # we had an error during discovery. Reset caches to align the data with the storage - if Discovery.out_of_memory_detected and "ERROR_DISCOVERY_OOM" not in self.__errors: - self.__errors.append("ERROR_DISCOVERY_OOM") self.__reset_caches() logging.error( f"Failed to run publish discovery for {self.sink_name}", exc_info=True, ) + finally: + if Discovery.out_of_memory_detected and "ERROR_DISCOVERY_OOM" not in self.__errors: + self.__errors.append("ERROR_DISCOVERY_OOM") + def __publish_new_nodes(self, current_nodes: List[NodeInfo]): # convert to map