-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Bug report
Description
On import of PIconnect.PIServer, _lookup_servers() in PIconnect/PI.py and PIconnect/PIAF.py iterate over and connect to each known Data Archive (DA) and Asset Framework (AF) Server respectively. I have +70 known DA servers (most geographically remote, many over a slow data link) and ~50 known AF servers (again most geographically remote, many over a slow data link). This causes package import to take several minutes.
To Reproduce
Steps to reproduce the behavior:
from PIconnect import PIServerExpected behavior
Package loads without iterating over and connecting to each DA and AF server.
Possible solutions
I am not sure if PIconnect is iterating over and connecting to each DA and AF server for any specific reasons other than to (1) make the connection and (2) list the known databases for each AF server. Even making an automatic connection to the default DA and AF server in _lookup_default_server() is potentially unwanted overhead, since I am always connecting to a specific system through PIServer() or PIAFDatabase().
Since the behavior happens at import, I think the only way to control that behavior is through an environment variable to bypass calls to _lookup_servers() and _lookup_default_server(); however this is only a guess.
System
- OS: [Windows]
- Python version: [Python 3.11]
- PIconnect version: [e.g. 0.10.6]