Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Skip databaseds backends in PyTango compatibility module #212

Merged
merged 1 commit into from Sep 4, 2018

Conversation

vxgmichel
Copy link
Contributor

@vxgmichel vxgmichel commented Sep 4, 2018

The PyTango module exists for backward-compatibility reasons. In order to manage different import statements (e.g. from PyTango import [...], import PyTango.[...]), all the pytango modules are imported and aliased in sys.modules. Any ImportError is ignored since some dependencies are optional.

This approach is fine as long as the modules don't show side effects on import. It turns out tango.databaseds.db_access.beacon imports bliss which, when it exists, uses gevent to monkey patch the python standard library. This can lead to issues that are quite hard to debug.

For this reason, the db_access modules are now filtered from this import routine. It shouldn't cause any backward compatibility issue since those modules are not really meant to be imported directly. They're usually imported by the tango.databaseds.database module on the fly, depending on the current configuration.

In the long run, the databaseds module should be refactored and properly documented. It should also provide a proper plugin system for the different database backends. Then, the most common database backends might stay in the project but the specific ones (such as beacon) should move to dedicated projects.

@ajoubertza
Copy link
Member

@vxgmichel Can you please provide some info in the PR description as to why this change is required?

@vxgmichel
Copy link
Contributor Author

Hi @ajoubertza,

I just added an explanation in the description. Let me know what you think about it.

Copy link
Member

@ajoubertza ajoubertza left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for the detailed explanation.

@vxgmichel vxgmichel merged commit 7cb7b30 into develop Sep 4, 2018
@vxgmichel vxgmichel deleted the compat-fix branch September 4, 2018 14:28
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.

None yet

2 participants