Ulm-IQO / qudi-core

A framework for modular measurement applications.
GNU General Public License v3.0
28 stars 21 forks source link

[Bug] rpyc 6 breaks connectors to remote modules #114

Open qku opened 3 days ago

qku commented 3 days ago

Version

Development

What is affected by the bug?

Local modules cannot connect to remote modules (e.g. local logic module to remote hardware module).

When does the bug occur?

Upon loading a module which connect to a remote module.

For me, this bug only occurs with rpyc version 6. It does not occur for rpyc 5.3.1

How do we replicate the issue?

  1. Configure the server: single hardware module (I used data instream dummy), allow remote
  2. Configure the client: remote hardware module, logic module with connector to remote hardware module (e.g. time series reader logic)
  3. Start server and load hardware module
  4. Start client and attempt to load logic module (hardware module by itself loads fine)

Expected behavior

Load the logic module without errors

Relevant log output

Traceback (most recent call last):
  File "/Users/kilian/projects/qudi/qudi-core/src/qudi/core/modulemanager.py", line 208, in activate_module
    self._modules[module_name].activate()
  File "/Users/kilian/projects/qudi/qudi-core/src/qudi/core/modulemanager.py", line 530, in activate
    module.activate()
  File "/Users/kilian/projects/qudi/qudi-core/src/qudi/core/modulemanager.py", line 533, in activate
    self._connect()
  File "/Users/kilian/projects/qudi/qudi-core/src/qudi/core/modulemanager.py", line 761, in _connect
    self._instance.connect_modules(module_connections)
  File "/Users/kilian/projects/qudi/qudi-core/src/qudi/core/module.py", line 408, in connect_modules
    conn.connect(target)
  File "/Users/kilian/projects/qudi/qudi-core/src/qudi/core/connector.py", line 90, in connect
    raise RuntimeError(
RuntimeError: Module "<qudi.hardware.dummy.data_instream_dummy.InStreamDummy(0x600001e92ba0) at 0x7fc35103ee80>" connected to connector "streamer" does not implement interface "DataInStreamInterface".

Additional Comments

No response

qku commented 10 hours ago

I seems like the underlying issue is know for rpyc and is described here: https://github.com/tomerfiliba-org/rpyc/issues/355

qku commented 10 hours ago

Here you can clearly see the different behaviour from the IPython console:

with rpyc 5.3.1

dummy = instream_dummy

dummy.__class__
Out[2]: <class 'qudi.hardware.dummy.data_instream_dummy.InStreamDummy'>

type(dummy)
Out[3]: <netref class 'rpyc.core.netref.qudi.hardware.dummy.data_instream_dummy.InStreamDummy'>

dummy.__class__.mro()
Out[4]: [<class 'qudi.hardware.dummy.data_instream_dummy.InStreamDummy'>, <class 'qudi.interface.data_instream_interface.DataInStreamInterface'>, <class 'qudi.core.module.Base'>, <class 'PySide2.QtCore.QObject'>, <class 'Shiboken.Object'>, <class 'object'>]

with rpyc 6.0.1

dummy = instream_dummy

dummy.__class__
Out[2]: <class 'module'>

type(dummy)
Out[3]: <netref class 'rpyc.core.netref.qudi.hardware.dummy.data_instream_dummy.InStreamDummy'>

dummy.__class__.mro()
Out[4]: [<class 'module'>, <class 'object'>]

Interestingly, the type method seems to yield a usable result to check for connector compatibility!