Skip to content

Mirrorlist should deal with unmatched, slightly incorrect versions and multiple minors for one major #1143

@jonathanspw

Description

@jonathanspw

This came up while releasing 9.5 - the mirror system currently cannot handle 9.5 and 9.4 being support versions at the same time because only one exists in the duplicated_versions mapping. This is a regression introduced by the kitten support PR.

Relevant points in code and errors:

https://github.com/AlmaLinux/mirrors/blob/mirrors_service/src/backend/api/handlers.py#L434
https://github.com/AlmaLinux/mirrors/blob/mirrors_service/src/backend/api/handlers.py#L434

/opt/mirror_service/src/backend/update_mirrors.py:272: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
Traceback (most recent call last):
  File "/opt/mirror_service/src/backend/update_mirrors.py", line 273, in <module>
    loop.run_until_complete(update_mirrors())
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 684, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/opt/mirror_service/src/backend/update_mirrors.py", line 269, in update_mirrors
    await task
  File "/opt/mirror_service/src/backend/update_mirrors.py", line 103, in update_mirrors_handler
    mirror_iso_uris = mirror_processor.get_mirror_iso_uris(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/mirror_service/src/backend/api/mirror_processor.py", line 472, in get_mirror_iso_uris
    for arch in arches[base_version]:
                ~~~~~~^^^^^^^^^^^^^^
KeyError: '9.5'

The expected functionality is for versions without a mapping in duplicate_version to still attempt to map to a valid major.

For example:

9.2 should map to 9
9.1111 should map to 9
9.97234 should map to 9

These are all past-supported versions, or invalid minors, but we should map the pattern to the major where we can make reasonable assumptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions