From 6e8428b70e8b5a97b97ae8fb49ac738f1f0cbe98 Mon Sep 17 00:00:00 2001 From: Simon Rose Date: Tue, 13 Oct 2026 15:38:53 +0200 Subject: [PATCH 1/3] Revert log severity change for updating IOC channel Unfortunately this gets caught on every channel after a restart since the iocid is different (host:port) in each case. This would _flood_ the info level logs for a typical IOC restart. Note that the log was being done twice, once before the call to _update_existing_channel_diff_iocid and once during. --- server/recceiver/cf/processor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/recceiver/cf/processor.py b/server/recceiver/cf/processor.py index 7e498d60..5c89b908 100755 --- a/server/recceiver/cf/processor.py +++ b/server/recceiver/cf/processor.py @@ -612,7 +612,6 @@ def _process_new_channels( ) new_properties = new_properties + record_info.info_properties if channel_name in existing_channels: - log.info("update existing channel %s: exists but with a different iocid from %s", channel_name, iocid) self._update_existing_channel_diff_iocid( existing_channels, channel_name, new_properties, channels, record_info_by_name, ioc_info, iocid ) @@ -816,7 +815,7 @@ def _update_existing_channel_diff_iocid( self.managed_properties, ) channels.append(existing_channel) - log.debug("Add existing channel with different IOC: %s", existing_channel) + log.debug("Add existing channel %s: exists but with a different iocid from %s", channel_name, iocid) if self.cf_config.alias_enabled and channel_name in record_info_by_name: alias_properties = [CFProperty(CFPropertyName.ALIAS.value, ioc_info.owner, channel_name)] + new_properties for alias_name in record_info_by_name[channel_name].aliases: From f1c9c87d3a6847d3e9d812ed04a855c057dc5395 Mon Sep 17 00:00:00 2001 From: Simon Rose Date: Wed, 14 Oct 2026 10:58:55 +0200 Subject: [PATCH 2/3] Invert order of environment variable addition to records Iterating over records then env vars meant (due to increased logging) that we logged _every_ record/env var combination. This change means that we log each environment variable that is missing only a single time. --- server/recceiver/cf/processor.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/server/recceiver/cf/processor.py b/server/recceiver/cf/processor.py index 5c89b908..04de2552 100755 --- a/server/recceiver/cf/processor.py +++ b/server/recceiver/cf/processor.py @@ -263,17 +263,17 @@ def _apply_env_vars( transaction: interfaces.ITransaction, ) -> None: """Append mapped EPICS environment variable properties to every record.""" - for record_id in record_infos: - for epics_env_var_name, cf_prop_name in self.env_vars.items(): - value = transaction.client_infos.get(epics_env_var_name) - if value is not None: + for epics_env_var_name, cf_prop_name in self.env_vars.items(): + value = transaction.client_infos.get(epics_env_var_name) + if value is not None: + for record_id in record_infos: record_infos[record_id].info_properties.append(CFProperty(cf_prop_name, ioc_info.owner, value)) - else: - log.info( - "EPICS environment var %s not found in IOC: %s", - epics_env_var_name, - ioc_info, - ) + else: + log.info( + "EPICS environment var %s not found in IOC: %s", + epics_env_var_name, + ioc_info, + ) @staticmethod def record_info_by_name(record_infos: Dict[str, RecordInfo], ioc_info: IOCInfo) -> Dict[str, RecordInfo]: From e051021f50a465ddcc9061fcaad05b166524fc0d Mon Sep 17 00:00:00 2001 From: Simon Rose Date: Thu, 15 Oct 2026 15:52:22 +0200 Subject: [PATCH 3/3] Copy client information when closing a session When closing a session we want to keep `client_info` for the closing transaction; this includes tidbits such as the IOC name and avoids the warning about ephemeral ports (which are not correct in this case) --- server/recceiver/recast.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/recceiver/recast.py b/server/recceiver/recast.py index 8f63156c..792f3db6 100644 --- a/server/recceiver/recast.py +++ b/server/recceiver/recast.py @@ -300,7 +300,8 @@ def close(self): # so that channels are registered as active in CF before the disconnect is processed. # The disconnect transaction is chained after self._commit_chain and will execute # once all preceding commits have finished. - self.transaction = Transaction(self.ep, id(self)) + transaction, self.transaction = self.transaction, Transaction(self.ep, id(self)) + self.transaction.client_infos = dict(transaction.client_infos) self.transaction.connected = False self.dirty = True self.flush()