Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Allow reading Door Status when macros are stopping #1695

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

HEnquist
Copy link

@HEnquist HEnquist commented Sep 22, 2021

This fixes a deadlock that happens if someone happens to read Status of the Door exactly while a scan is stopping.
The problem is that the Status command takes the TangoMonitor of the Door device server, and then dev_status calls methods that are decorated by mAPI. This makes it wait until the running macro has stopped. It's holding the Monitor for this entire time and that causes all kinds of trouble. For example the logging fails on push_change_event(), and there are change events on other attributes as well during the stopping procedure. Every such attempt will fail with:

PyTango.DevFailed: DevFailed[
DevError[
    desc = Not able to acquire serialization (dev, class or process) monitor
  origin = TangoMonitor::get_monitor
  reason = API_CommandTimedOut
severity = ERR]
]

@@ -2238,6 +2238,12 @@ def parent_macro(self):
internally by the *Executor*"""
return self._parent_macro

@property
def _command(self):
Copy link
Author

@HEnquist HEnquist Sep 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should this be called? Just command feels dangerous, big risk of clashing with something in some macro. And the underscore doesn't match the rest of the unofficial api, whileget_command should be a function rather than a property.
A few other alternatives: command_string, macro_command, formatted_command...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant