Repository navigation
enh: do not retry API requests when the server name cannot be resolved - #125
Merged
paulmueller merged 1 commit intoNov 4, 2026
Merged
Conversation
A failed name lookup is rarely transient, and on the Windows runners every failed lookup took about 37 s. With 1 try plus 3 retries per request, DCOR-Aid froze for minutes when started with a wrong server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #125 +/- ##
==========================================
- Coverage 72.72% 72.67% -0.06%
==========================================
Files 72 72
Lines 6057 6063 +6
==========================================
+ Hits 4405 4406 +1
- Misses 1652 1657 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
paulmueller-agent
force-pushed
the
no-retry-name-resolution
branch
from
November 4, 2026 21:12
5adf535 to
5a9e6dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #124: instead of only speeding up the test, stop retrying requests whose host name cannot be resolved.
Problem
retry_strategyindcoraid/api/ckan_api.pytreats aNameResolutionErrorlike any other connection error, so every request to a wrong server name made 1 try + 3 retries with back-off. DCOR-Aid makes 8 such requests at startup/shutdown with a wrong server, so the main window took 45 s to open on Linux and 20 min on the Windows runners, where each failed lookup takes about 37 s. A real user with a mistyped server name would see the same freeze.Change
RetryExceptNameResolution: aurllib3Retrysubclass whoseincrementraisesMaxRetryErrorright away forNameResolutionError; everything else (connect/read retries, back-off) is unchanged.requestsstill raises aConnectionErrorwith "Failed to resolve" in the message.test_api_no_retry_on_name_resolution_error(host name lookup is mocked and must happen exactly once).Effect (local, Linux)
test_gui_start_with_bad_server: 45 s → 0.35 stest_cli_fail_wrong_server_httperror: 90 s → 0.29 s (the CLI's own "Retrying ..." loop still runs)With this, the mock added in #124 is no longer needed for speed, but it still keeps the test independent of DNS. Tell me if you'd rather drop #124.
ruff and flake8 pass;
tests/test_api_base.pyand the two tests above pass locally.🤖 Generated with Claude Code