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

Long timeout for checking remote AI versions #163

Open
rakrok opened this issue Jun 2, 2024 · 0 comments
Open

Long timeout for checking remote AI versions #163

rakrok opened this issue Jun 2, 2024 · 0 comments

Comments

@rakrok
Copy link

rakrok commented Jun 2, 2024

Hello,

Last night it seems like there was an issue with minio.schmelly.de, which caused my command-line invocations of GraXpert to hang on connect and timeout after many minutes. I forget now how long it took between the retries, but I believe each retry was 5 minutes and there were several of them (IIRC 5). Since I was running this through the GraXpert PixInsight plugin, there is no way to abort the process (as compared to e.g. the command line). Also FYI this was a connection hang (not an RST), so the retries took forever.

It would be nice if we could reduce this timeout and number of retries to something smaller. I don't have an opinion other than 5 minutes and 5 retries seems excessive :-)

I think the way to fix this is to pass in an http_client to the Minio constructor and specify the timeout there. This is a copy/paste of the http_client that is constructed within Minio, except with shorter timeouts. In ai_model_handling.py it would look like this:

timeout = 30 # seconds
http_client = urllib3.PoolManager(
            timeout=Timeout(connect=timeout, read=timeout),
            maxsize=10,
            cert_reqs='CERT_REQUIRED',
            ca_certs=os.environ.get('SSL_CERT_FILE') or certifi.where(),
            retries=Retry(
                total=2,
                backoff_factor=0.2,
                status_forcelist=[500, 502, 503, 504]
            )
        )
client = Minio(endpoint, ro_access_key, ro_secret_key, http_client=http_client)

I haven't been able to test this as I'm unable to build & run GraXpert myself (the instructions seem out of date, e.g. the onnxruntime was moved from requirements.txt, and then there is a failure in opening the s3 secrets files).

Let me know if I can provide any additional info. Or if you can let me know how to build GraXpert I can test this and submit a merge request. Thanks!

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