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

Add documentation for retry configuration in pystac-client and enable them by default #520

Closed
pv-98 opened this issue May 19, 2023 · 2 comments · Fixed by #532
Closed

Add documentation for retry configuration in pystac-client and enable them by default #520

pv-98 opened this issue May 19, 2023 · 2 comments · Fixed by #532
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@pv-98
Copy link

pv-98 commented May 19, 2023

Please refer the API error issue for the problems faced.

@gadomski gadomski added the documentation Improvements or additions to documentation label May 19, 2023
@TomAugspurger
Copy link
Collaborator

I wonder if this is the same as custom certificates? Something like

from pystac_client.stac_api_io import StacApiIO
from pystac_client.client import Client
from requests.adapters import HTTPAdapter, Retry

stac_api_io = StacApiIO()
retries = Retry(total=5, backoff_factor=1, status_forcelist=[ 502, 503, 504 ])
stac_api_io.session.mount(
    "http://", HTTPAdapter(max_retries=retries)
)
client = Client.open("https://planetarycomputer.microsoft.com/api/stac/v1", stac_io=stac_api_io)

@gadomski gadomski added the enhancement New feature or request label May 25, 2023
@gadomski gadomski added this to the 0.7.0 milestone May 25, 2023
@gadomski
Copy link
Member

Don't see why that wouldn't work, but since we're a network-y library, I think it'd make sense to add retries as a configuration option to StacApiIO. I'm marking this issue as an enhancement to track.

FYI here's the relevant bits of the RetryStacIO in pystac: https://github.com/stac-utils/pystac/blob/e196e50bd23b52169d2f85fcd2d126fc7258684f/pystac/stac_io.py#L439-L444

johntruckenbrodt added a commit to SAR-ARD/s1ard that referenced this issue Jun 4, 2023
The catalog was found to occasionally not be reachable and the pystac-client library does not yet offer an option to increase timeout or retry.
However, this is about to change in later versions: stac-utils/pystac-client#520.
@gadomski gadomski self-assigned this Jun 7, 2023
@gadomski gadomski mentioned this issue Jun 7, 2023
3 tasks
rubenbaer referenced this issue in rubenbaer/eodal Aug 16, 2023
The issue `https://github.com/stac-utils/pystac-client/issues/520` is closed:
The default retries are set for timeouts but not for `50x` responses. Thus the code is left as is.
rubenbaer added a commit to rubenbaer/eodal that referenced this issue Aug 18, 2023
Issue `stac-utils/pystac-client#520 is closed. But can not yet be used
with currently supported python version. Added reminder for future versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants