diff --git a/server/recceiver/cf/processor.py b/server/recceiver/cf/processor.py index 7e498d60..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]: @@ -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: 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()