Ulm-IQO / qudi-core

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

Parallel local qudi sessions #34

Closed Neverhorst closed 1 year ago

Neverhorst commented 1 year ago

Description

This small PR will allow to run multiple local qudi sessions in parallel.

Motivation and Context

The rotating file handler of the qudi logging facility has prevented this before due to file access conflicts. Now the qudi logger will detect if the log file is already owned by another qudi process and create a new file with a running session index in the name.

However the user must ensure each instance of qudi is running with a different namespace (and remote modules) socket server address configured in order to avoid conflicts.

How Has This Been Tested?

Dummy modules windows 10 Pro 21H2 (build 19044.2130)

Types of changes

Checklist:

kay-jahnke commented 1 year ago

Tested in Win10 Pro 21H2, with python 3.8.

In principle it works fine now to start qudi twice. If both qudi instances load the same config (which they do by default) or if different configs have the same ports configured for rpyc, this causes the following error (qudi starts nonetheless and the console window works): grafik

Not sure if this actually a bug but rather the intended behavior when using the same port.

Neverhorst commented 1 year ago

Tested in Win10 Pro 21H2, with python 3.8.

In principle it works fine now to start qudi twice. If both qudi instances load the same config (which they do by default) or if different configs have the same ports configured for rpyc, this causes the following error (qudi starts nonetheless and the console window works): grafik

Not sure if this actually a bug but rather the intended behavior when using the same port.

You can not use the same port for different servers, that's why I mentioned this in the PR comments and changelog. It's the user responsibility to load a separate config for each qudi instance with separate ports, e.g. by running qudi with the --config argument.

Neverhorst commented 1 year ago

And the "working" console in the error case you mentioned @kay-jahnke is actually interfacing with the first started qudi instance. (as can be seen in the log of the first started instance... something like "client connected...".