grpc / grpc/grpc-java

Revisit the threading and ordering guarantees of StreamTracer

オープン
#3,489 コメント 1 件 リアクション 0 件 担当者 1 名 @zhangkun83 に割り当て済み GitHub で見る
enhancement
主要言語
Java
スター
12.1k
フォーク
4k
平均マージ
2日 17時間
マージ済み PR(30日)
37

説明

Currently `StreamTracer` must be thread-safe, as gRPC doesn't guarantee synchronized invocation for it. While the entire class can't be marked as not-thread-safe, as `inboundUncompressedSize()` may be called from a different thread (app thread) from `inboundMessage()` (network thread), some methods are called sequentially, e.g., `inboundMessage()` and `outboundMessage()`. If a tracer implementation only cares about `inboundMessage()`, it may be totally safe to not to synchronize. We need to find a way to relax the thread-safety requirement to make it easier to implement.

We also need a better definition on the ordering of the methods, e.g., is it possible for `inboundMessage()` to happen after `streamClosed()`?

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

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

評価

この issue はまだ評価されていません。

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

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