swift-server / swift-server/async-http-client

Accept any EventLoops in `.delegate(on:)`, not just ones from AHC's own ELG

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

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

主要言語
Swift
スター
1.1k
フォーク
156
PR マージ指標
30日以内にマージされた PR はありません

説明

The badly named but highly useful .delegate(on:) specifies two things:

  1. Which EventLoop the returned futures are bound to
  2. Which EventLoop the delegate callouts happen on.

Crucially it does not specify on what EventLoop the underlying Channels are running on. Yes, as an optimisation if possible & sensible (i.e. the connection pool doesn't already have a valid connection) we try to create new Channels on the same EventLoop but that's neither guaranteed nor required.

Expected behaviour

If I pass a random EventLoop to AHC's eventLoop: .delegate(on: myRandomEL) then I would expect this to work, even if AHC itself is using an EventLoopGroup that doesn't contain my EventLoop for its Channels.

Actual behaviour

AHC crashes and tells me that I can only use EventLoops from AHC's EventLoopGroup at runtime. That's bad an unnecessary.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

.delegate(on:) のエントリーポイントから開始し、渡された EventLoop を AHC 独自の EventLoopGroup に制限しているランタイム検証を追跡します。別のグループの EventLoop を使ったテストカバレッジを追加し、そのうえで、基盤となる Channels が引き続き AHC によって管理されながら、クラッシュせずに委譲が機能することを確認します。

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

評価

技術スタック
swift
領域
networking
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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