Skip to content

No timeout for version_check's requests #2726

@yujiehecs

Description

@yujiehecs

Describe the bug

By default, utils.version_check() is called every time when an Interface is instantiated, as in

utils.version_check()

However, the requests.get() call within version_check() does not have timeout config, as in

latest_pkg_version = requests.get(url=PKG_VERSION_URL).json()["version"]

This leads to forever waiting time when in certain environment, external network connection is disabled.

There was an issue #2052 that might resolve this problem by converting the http call to be async. But it was not directly fix this 'bug'?

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

Not sure how to share the exact setting, but I'm attaching an screenshot after I run
pyinstrument app.py
during which, it took ~ 5 minutes to launch the application, where app.py is my own toy app that includes TabbedInterface.launch.

Screenshot

pyinstrument

Logs

N/A

System Info

gradio==3.11.0
MaxOS M1
Chrome

Severity

serious, but I can work around it

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions