diff --git a/README.md b/README.md index 07b967dbca5f7e59701d4fcee6603e4ce384eff9..e9fe06df606d156d4806a18c8927295e76d91266 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,7 @@ Next change the version in the following places: # Release Notes +* 0.45.4 Fix device server freeze during initialise command * 0.45.3 Reduce Loki log output * 0.45.2 Remove dead code * 0.45.1 Have get_defaults return a dict instead of list, and fix returning numpy arrays diff --git a/tangostationcontrol/VERSION b/tangostationcontrol/VERSION index 460e2afaa26a215dac22097bed5fea4abd4d07f3..ac8f038e0eee8908ea4b0d0ad47411fc95d8cfe9 100644 --- a/tangostationcontrol/VERSION +++ b/tangostationcontrol/VERSION @@ -1 +1 @@ -0.45.3 +0.45.4 diff --git a/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py index f0c45fcafc1b51bbffcd92d2a6a9b14f531bfcec..1ff7fd050f7b8bf3e194560c4e2e1649bb8a5aa5 100644 --- a/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py @@ -584,7 +584,12 @@ class LOFARDevice(Device): ] def reset_tango_polling(self): - """Reset the Tango polling configuration.""" + """Reset the Tango polling configuration. + + Do NOT call this after the device initialisation, as the polling thread might be + about to block on the GIL to read an attribute (including state/status!). This + causes any interaction with the poller to block in turn, leading to a deadlock. + """ # stop polling everything for attr_name in self._tango_polled_attributes(): @@ -625,6 +630,8 @@ class LOFARDevice(Device): # NOTE: Will delete_device first, if necessary super().init_device() + self.reset_tango_polling() + self._init_device() @log_exceptions() @@ -661,7 +668,6 @@ class LOFARDevice(Device): # reload our class & device properties from the Tango database self.get_device_properties() self.properties_changed() - self.reset_tango_polling() # a thread running to schedule work in. This thread is active # from configure_for_initialise up to and including configure_for_off.