From 8c552f50a83a38425a312f447b5d5afafc084456 Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Mon, 20 Oct 2025 15:56:00 -0300 Subject: [PATCH] SIENTIAPDE-1312 Fix pod URI formatting and enhance disconnection error logging in OpcManager - Updated pod URI construction to replace hyphens with colons for correct formatting. - Improved error logging during disconnection attempts to include the attempt number for better traceability. - Changed disconnection_fallback method call to be awaited for proper asynchronous handling. --- ingestor/managers/opc_manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ingestor/managers/opc_manager.py b/ingestor/managers/opc_manager.py index 113473f..09ee184 100644 --- a/ingestor/managers/opc_manager.py +++ b/ingestor/managers/opc_manager.py @@ -197,7 +197,7 @@ class OpcManager(BaseActivity): self.client.name = self.pod_id self.client.application_name = self.pod_id - pod_uri = f'urn:sientia-do:pod:{self.pod_id}' + pod_uri = self.pod_id.replace('-', ':') self.client.application_uri = pod_uri self.client.product_uri = pod_uri @@ -347,7 +347,7 @@ class OpcManager(BaseActivity): await self.client.disconnect() return [] except Exception as e: - self.logger.error(f'Failed to disconnect from OPC UA server: {e}') + self.logger.error(f'Failed to disconnect from OPC UA serve in attempt {i+1} of 5: {e}') error_stack.append({ 'attempt': i+1, 'error': str(e), @@ -387,7 +387,7 @@ class OpcManager(BaseActivity): self.logger.error(f'Failed to clean up subscription: {sub_error}') - errors = self.disconnection_fallback() + errors = await self.disconnection_fallback() if errors: self.send_notification(