Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLM Manager sometimes spawning new Main Window processes on PV conn. check (caproto read) #1

Open
mihai-stfc opened this issue Jan 4, 2021 · 1 comment
Labels
bug Something isn't working Manager Ticket concerning the HLM PV Import Service Manager

Comments

@mihai-stfc
Copy link
Collaborator

mihai-stfc commented Jan 4, 2021

Description

In a packaged app with PyInstaller (either onefile or dir), for each caproto read call, a new app process would spawn. For example, if 4 PV names were given and "Check PVs" button clicked, after a short while, four different manager main windows (each with its own process) would appear on top of each other.

This will happen for each PV that is tested, thus each caproto.sync.client read call, even though only one QThread is responsible for testing the PVs.

Notes

This may be caused by a weird interaction between PyInstaller's frozen code handling of multithreading/multiprocessing (?) and caproto (sync client).

Issue encountered first on NDAHEMON, then on personal desktop as well.
Bug was never encountered on developer machine (IDE or packaged app).

To see if this is a compatibility issue with NDAHEMON or with the .exe, ran the app on personal machine and issue was encountered again, so it is not an issue with NDAHEMON.

Personal machine fix (?)

After encountering the issue on the personal machine as well, downloaded code from the git repository, installed modules from requirements.exe, ran the HLM Manager with PyCharm IDE - no issues.
Closed PyCharm, uninstalled all packages from requirements from Python.
Ran packaged .exe from before - no issues: Somehow the issue was fixed on the personal desktop by fetching the code and running it via PyCharm IDE.

NDAHEMON fix (?)

Enabled gateway from work machine NDW2123, so that NDAHEMON can read PVs for the time being (until the IOC is set-up on it as well).
Added work machine's IP to NDAHEMON's EPICS_CA_ADDR_LIST. Tested it can connect to PVs using caget TE:NDW2123:HA:HLM:MOTHER_DEWAR:HE_LEVEL, it worked.

After these steps, the issue was somehow resolved on NDAHEMON as well - a new process no longer spawns on caproto read.

How to reproduce

Because the issue somehow resolved itself, the cause is uncertain.
To attempt reproduce, simply run the HLM Manager .exe, set up the DB Connection in settings, open ConfigEntry window by clicking the New/Add Config button on left of the PV Config table, write some PV names (or anything) in the Measurement PVs fields, then click the PV Connection Check button.
If establishing a HLM DB connection is not possible, remove the return statement from new_config_btn_clicked in ServiceManager\GUI\main_window.py (to be able to open the ConfigEntry dialog) then re-freeze with PyInstaller.

@mihai-stfc
Copy link
Collaborator Author

The "fix" is only temporary, as the issue occurred again on NADHEMON last Tuesday (26 Jan), when testing a PVs connection in the ConfigEntry dlg.

@mihai-stfc mihai-stfc added the bug Something isn't working label Jun 25, 2021
@mihai-stfc mihai-stfc added the Manager Ticket concerning the HLM PV Import Service Manager label Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Manager Ticket concerning the HLM PV Import Service Manager
Projects
None yet
Development

No branches or pull requests

1 participant