From 497a7abffb6457bab42275dc18bfabfaeae6c16b Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Thu, 3 Sep 2026 01:58:40 +0200 Subject: [PATCH] Do not cache an SDR that failed to build init_sdr assigned self._sdr before initialize() ran, so a failure left the half built object in the cache. The next call saw a non-None _sdr and handed back that partial repository rather than trying again. The visible symptom is a first call raising and the second appearing to succeed. The real cost is on a bmc where the read fails once: the client keeps the incomplete sdr for the life of the session and every later sensor lookup answers from it without complaint. --- confluent_server/aiohmi/ipmi/command.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/confluent_server/aiohmi/ipmi/command.py b/confluent_server/aiohmi/ipmi/command.py index 3612b998..6dcd1e20 100644 --- a/confluent_server/aiohmi/ipmi/command.py +++ b/confluent_server/aiohmi/ipmi/command.py @@ -605,8 +605,12 @@ class Command(object): if hasattr(self._oem, 'init_sdr'): self._sdr = await self._oem.init_sdr() else: - self._sdr = sdr.SDR(self, self._sdrcachedir) - await self._sdr.initialize() + # Assigned only once it is built. Assigning first meant a + # failed initialize left the half built object cached, and + # every later call returned that instead of retrying. + newsdr = sdr.SDR(self, self._sdrcachedir) + await newsdr.initialize() + self._sdr = newsdr return self._sdr async def get_event_constants(self):