Skip to content

Fix connect attempt retries#13102

Draft
masaori335 wants to merge 4 commits intoapache:masterfrom
masaori335:asf-master-fix-connect-attempt-retry
Draft

Fix connect attempt retries#13102
masaori335 wants to merge 4 commits intoapache:masterfrom
masaori335:asf-master-fix-connect-attempt-retry

Conversation

@masaori335
Copy link
Copy Markdown
Contributor

Summary

We have three configs of connect attempt retry. However, prior to the change, none of them are implemented correctly. This PR makes the retry path honor the HostDBInfo state across the board.

  • connect_attempts_max_retries
  • connect_attempts_max_retries_down_server
  • connect_attempts_rr_retries

Changes

  • New helper HttpTransact::origin_server_connect_attempts_max_retries(State*) returns the retry limit based on the active HostDBInfo::State :

    • UP → connect_attempts_max_retries
    • SUSPECT → connect_attempts_max_retries_down_server
    • DOWN → 0
  • HttpTransact::handle_response_from_server is refactored and retry logic is fixed.

  • Fix round-robin logic in ResolveInfo::select_next_rr(now, fail_window)

  • HttpSM::mark_host_failure now uses origin_server_connect_attempts_max_retries(s) + 1 as the DOWN threshold (was incorrectly using connect_attempts_rr_retries).

  • HttpSM::do_hostdb_update_if_necessary records failure time via ts_clock::now() instead of client_request_time so multiple connect attempts in one transaction get distinct timestamps.

Tests

  1. New connect_attempts_single_max_retries.replay.yaml exercises connect_attempts_max_retries and connect_attempts_max_retries_down_server for single DNS Record (no round-robin case)
  2. Updated connect_attempts_rr_retries.replay.yaml and gold files to reflect the corrected RR + SUSPECT behavior.
  3. Updated connect_attempts_rr_max_retries gold to match the new state-aware fail-count threshold.

Dependency

This PR is in draft until below PRs are merged.

@masaori335 masaori335 force-pushed the asf-master-fix-connect-attempt-retry branch from 6cb96f3 to 89cf54f Compare April 21, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant