Skip to content

Request to pypi to fetch version blocks connection indefinitely #649

@rexdez

Description

@rexdez

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions