Observed at
|
"https://pypi.org/pypi/aperturedb/json").text)["info"]["version"] |
Problem
Whenever a user attempts to initialize a new connection, the above mentioned __init.py file makes request for latest version of aperturedb-python package. If pypi.org is unreachable (VPN, air-gapped environment, slow network), this hangs indefinitely and blocks any program that imports the package. Even if the DB is running in localhost port
Observation details
OS: MAC OS
WAIT TIME: 2 minutes
EXIT: ctrl + c keyboard interrupt to cancel connection
VERSION: aperturedb 0.18.15
PYTHON-VERSION: Python 3.12
Expected Behaviour
Importing the package should not make blocking network calls, or at minimum should have a short timeout.
Solution
Implementation of timeout for HTTP call for package latest version request.
Observed at
aperturedb-python/aperturedb/__init__.py
Line 86 in 8acb383
Problem
Whenever a user attempts to initialize a new connection, the above mentioned
__init.pyfile makes request for latest version of aperturedb-python package. If pypi.org is unreachable (VPN, air-gapped environment, slow network), this hangs indefinitely and blocks any program that imports the package. Even if the DB is running in localhost portObservation details
OS: MAC OS
WAIT TIME: 2 minutes
EXIT:
ctrl + ckeyboard interrupt to cancel connectionVERSION: aperturedb 0.18.15
PYTHON-VERSION: Python 3.12
Expected Behaviour
Importing the package should not make blocking network calls, or at minimum should have a short timeout.
Solution
Implementation of timeout for HTTP call for package latest version request.