Make ServerImpl's internalClose thread-safe
オープン
まだ誰も着手していません。
bug
- 主要言語
- Java
- スター
- 12.1k
- フォーク
- 4k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 37
説明
So we have this in ServerImpl.JumpToApplicationThreadServerStreamListener:
/**
* Like {@link ServerCall#close(Status, Metadata)}, but thread-safe for internal use.
*/
private void internalClose() {
// TODO(ejona86): this is not thread-safe :)
stream.close(Status.UNKNOWN, new Metadata());
}
We should fix that. There's two ways to fix this:
- Allow truncated messages in our stream and deliver trailers. This would be nicest and would be helpful in other cases (like if too many requests are sent in a server call), as we can deliver a message to the client
- Treat this as a cancel and send RST_STREAM. This would be similar to client-side cancellation, but we'd still need to verify it'd be safe on server-side.
In either case it'd probably be good if we made this trigger onCancel instead of onCompleted. That'd probably happen naturally for (2), but (1) would need special plumbing, but it's probably not too onerous.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ServerImpl.JumpToApplicationThreadServerStreamListener から開始し、stream.close まで internalClose を追跡します。truncated-message/trailers と cancellation の代替案を、onCancel と onCompleted の動作の違いを含めて比較します。internalClose がスレッドセーフで、結果として生じる callback のセマンティクスが検証されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- api, backend
- issue の種類
- バグ
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100