Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

No source of entropy in _get_nearest_mirrors_by_network_data()

オープン
#562 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

src/backend/api/handlers.py の _get_nearest_mirrors_by_network_data()(73行目付近)から始め、ネットワークに一致する mirror と地理的に選択された mirror がどのように組み立てられるかを追跡します。推奨されている2つのシャッフル手順を既存の長さ制限と比較します。対象となるクライアントが多様な mirror の順序を受け取り、なおかつ提示されるリストが意図したサイズを満たしていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

When a client matches the network data service cone for any mirror, the offered mirror list is built using the following logic:

  1. Append mirror matching on ASN or subnet
  2. Create sorted list of mirrors by distance, filter out mirrors matching on first criteria, and extend list to desired minimum (LENGTH_CLOUD_MIRRORS_LIST)

The issue is that this process is completely deterministic and there is no load balancing for clients that match on any mirror's network service cone. There is no shuffling happening in either the first list of suitable_mirrors or the geographically based extension of the list to meet the minimum number of mirrors to offer.

Failure modes:

  1. A particularly large install base of hosts relies on a local mirror. When this mirror goes offline and before the health checkers have disqualified this mirror, ALL clients on the local subnet are steered to the next closest public mirror.
  2. An EXTREMELY large install base of hosts with two local mirrors are not able to load balance between the two mirrors. The list of mirrors is always returned in the same order (probably based on the order they happened to be added to the mirror database)

Recommendation:

  1. Shuffle list of mirrors which match on network data before the geographically based extension of the list.
  2. Generate a longer geographic extension of the list, shuffle, and then use to extend the original list. i.e. find the 2 * LENGTH_CLOUD_MIRRORS_LIST closest mirrors, shuffle this list, then suitable_mirrors.extend(nearby_mirrors_shuffled)[:LENGTH_CLOUD_MIRRORS_LIST - len(suitable_mirrors)]
主要言語
Python
スター
93
フォーク
486
平均マージ
1日 23時間
マージ済み PR(30日)
7

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AlmaLinux/mirrors のほかの issue

AlmaLinux/mirrors の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。