Skip to content

Conversation

@h8d13
Copy link
Contributor

@h8d13 h8d13 commented Dec 25, 2025

Aims to fix #4029 or start a discussion about it (I've had this when the endpoint is down).

By assigning a bool to the def load_remote_mirrors in the parent (which was naïve about the state).

This can be tested on the branch above and using something similar to block URL (temporarily):

echo "127.0.0.1 archlinux.org" | sudo tee -a /etc/hosts or when it's down like currently (15:00 UTC+1).

Second thing I'm wondering about:

  def get_status_by_region(self, region: str, speed_sort: bool) -> list[MirrorStatusEntryV3]:
      mappings = self._mappings()
      region_list = mappings[region]

      # Only sort if we have remote mirror data with score/speed info
      # Local mirrors lack this data and can be modified manually before-hand
      # Or reflector potentially ran already
      if self._fetched_remote and speed_sort:
          # original return
          return sorted(region_list, key=lambda mirror: (mirror.score, mirror.speed))
      # just return as-is without sorting?
      return region_list

Another day another DDoS ? I'll ping thsi for the funny lore too #3974

@h8d13 h8d13 marked this pull request as ready for review December 25, 2025 14:14
@h8d13 h8d13 requested a review from Torxed as a code owner December 25, 2025 14:14
@h8d13 h8d13 changed the title Fix mirrors hang Fix mirrors hang when /status endpoint is down Dec 25, 2025
@h8d13
Copy link
Contributor Author

h8d13 commented Dec 26, 2025

Also had fun on another branch where we can use mirror endpoint from archlinux.de (or other models?)

master...h8d13:archinstall-patch:refs/heads/dot-mirrors-de

@Torxed
Copy link
Member

Torxed commented Dec 26, 2025

We could also fall back to /etc/pacman.d/mirrorlist as it should contain a new enough mirror list when we can't use the online lookup.

And the regions are "there" in the shape of comments, so we'd just need to parse "which region are we currently on" and all subsequent mirror entries (even if commented out) belong to that region.

@h8d13
Copy link
Contributor Author

h8d13 commented Dec 26, 2025

It is already the fallback behavior problem was that timeout didn't work and the parent logic didn't know about the child status

The extra options are totally optional and can be cherry picked if you don't want them (today's commits)

@Torxed
Copy link
Member

Torxed commented Dec 26, 2025

Ah, I think I'm slowly waking up and getting the hang of this.

So would the --offline flag be sufficient instead of the following, or do we need the fine tuning of arguments and code logic:

parser.add_argument(
'--local-mirr',
action='store_true',
default=False,
help='Disabled mirrors fetch and use local existing file instead.',
)

I'm not against it, just wondering if --offline could serve well here, as it would help with other online issues too.



def fetch_data_from_url(url: str, params: dict[str, str] | None = None) -> str:
def fetch_data_from_url(url: str, params: dict[str, str] | None = None, timeout: int = 3) -> str:
Copy link
Member

Choose a reason for hiding this comment

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

The default timeout can probably be increased to 15 or even 20.
As I know some regions struggle with latency and speeds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Arch install stuck in mirror

2 participants