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

Prevent validator errors/retries on read timeouts #1056

Merged
merged 4 commits into from Jan 26, 2022

Conversation

ml-evs
Copy link
Member

@ml-evs ml-evs commented Jan 26, 2022

The last PR (#1051) introduced explicit read timeouts and reduced the default value to 30 seconds. After some testing with the dashboard, 30 seconds is quite a harsh timeout for some implementations/requests, so this is now increased to 2 minutes by default. Also, as requests.exceptions.ReadTimeout does not subclass requests.exceptions.ConnectionError, these requests were failing with "internal" validator errors, rather than being handled as errors related to the implementation.

This PR fixes that error handling, and additionally prevents read timeouts from triggering retries. A CLI arg was also added for --read-timeout for easier testing.

@ml-evs ml-evs changed the title Prevent errors/retries on read_timeouts Prevent errors/retries on read timeouts Jan 26, 2022
optimade/validator/utils.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 26, 2022

Codecov Report

Merging #1056 (0653af2) into master (b216947) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1056   +/-   ##
=======================================
  Coverage   92.90%   92.90%           
=======================================
  Files          67       67           
  Lines        3790     3790           
=======================================
  Hits         3521     3521           
  Misses        269      269           
Flag Coverage Δ
project 92.90% <100.00%> (ø)
validator 92.90% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
optimade/validator/__init__.py 100.00% <100.00%> (ø)
optimade/validator/utils.py 94.63% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b216947...0653af2. Read the comment docs.

Co-authored-by: Casper Welzel Andersen <43357585+CasperWA@users.noreply.github.com>
@ml-evs ml-evs requested a review from CasperWA January 26, 2022 14:40
Copy link
Member

@CasperWA CasperWA left a comment

Choose a reason for hiding this comment

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

Cheers. Seems you also upped the default readout time to 60 s - I presume this is intentional and not from some local changes and testing? :)

@ml-evs
Copy link
Member Author

ml-evs commented Jan 26, 2022

Cheers. Seems you also upped the default readout time to 60 s - I presume this is intentional and not from some local changes and testing? :)

Yeah, its in the description above, it seems that some of the bigger validator queries reliably hit 30 seconds for some implementations, so I've upped the default.

@ml-evs ml-evs merged commit b473382 into master Jan 26, 2022
@ml-evs ml-evs deleted the ml-evs/validator_tweaks branch January 26, 2022 15:49
@ml-evs ml-evs changed the title Prevent errors/retries on read timeouts Prevent validator errors/retries on read timeouts Jan 31, 2022
@ml-evs ml-evs added the validator Related to the OPTIMADE validator label Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validator Related to the OPTIMADE validator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants