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

Version Check may lead to deadlock of threadings #492

Open
kssamwang opened this issue Oct 22, 2024 · 0 comments
Open

Version Check may lead to deadlock of threadings #492

kssamwang opened this issue Oct 22, 2024 · 0 comments

Comments

@kssamwang
Copy link

kssamwang commented Oct 22, 2024

In version.py, you start a new thread to check whether it is the latest version.

import os
import logging
from threading import Thread

__version__ = '1.3.6'

try:
    os.environ['OUTDATED_IGNORE'] = '1'
    from outdated import check_outdated  # noqa
except ImportError:
    check_outdated = None


def check():
    try:
        is_outdated, latest = check_outdated('ogb', __version__)
        if is_outdated:
            logging.warning(
                f'The OGB package is out of date. Your version is '
                f'{__version__}, while the latest version is {latest}.')
    except Exception:
        pass


if check_outdated is not None:
    thread = Thread(target=check)
    thread.start()

If some network errors occur in the request of version check , this thread remains alive , when the python program is going to quit , this thread may lead to deadlock in multi-threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant