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

Log message for timeout error when loading model artefacts #142

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion earth2studio/models/auto/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ def _open(self, path, mode="rb", **kwargs): # type: ignore
f2.write(data) # type: ignore
else:
if "callback" in kwargs: # Patch here
self.fs.get_file(path, fn, callback=kwargs["callback"])
try:
self.fs.get_file(path, fn, callback=kwargs["callback"])
except fsspec.exceptions.FSTimeoutError as exc:
timeout = Package.default_timeout()
m = 'Loading model artefact resulted in timeout. Consider increasing timeout through environment variable "EARTH2STUDIO_PACKAGE_TIMEOUT". Currently it is set to %s seconds.' % timeout
logger.error(m)
Comment on lines +102 to +103
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a linting error. From your local copy of the project directory, please run make setup-ci and make lint.

raise exc
else:
self.fs.get_file(path, fn)
self.save_cache()
Expand Down