danielgtaylor / danielgtaylor/python-betterproto

unary_stream message issue

オープン
#430 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
1.8k
フォーク
234
PR マージ指標
30日以内にマージされた PR はありません

説明

I'm currently facing the issue that a unary_stream connection does not behave as I would expect. (betterproto version b5)

## Client code:
![image](https://user-images.githubusercontent.com/79153884/193418261-880ae8b2-75bf-4ee5-a707-72404a92637c.png)

## Server code:
![image](https://user-images.githubusercontent.com/79153884/193418299-f9e63c37-e4a3-4ecb-a32a-ae76b1103c33.png)
![image](https://user-images.githubusercontent.com/79153884/193418312-331223ad-8c15-43e9-ba5f-0d46b8617b38.png)

Opening the connection works fine, the server receives the request and begins its job.
The task the server performs is taking 1 min +/-, during that time it sends multiple responses to the client.
While debugging I could see that subroutines have been executed and sending data (server side).

But nothing arrives at the client, the red X located at the client if statement is a breakpoint that never executes until after the server method returns. If I breakpoint the server at its last statement (red X) the client is idle. Only after continuing, allowing the server to complete the method (closing the connection?), within the client program the subroutines trigger:
![image](https://user-images.githubusercontent.com/79153884/193418482-1e8314d9-753c-4c9d-9db5-f473a0fda2d5.png)

All messages then are 'spammed' to the waiting client. At first glance, nothing is missing, but I expected the stream to work like in the default google implementation. Receiving the messages one after another when sent from the server.
Is this intended behavior?

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

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

調査の方向性

Issue に示されている client と server の unary_stream 例を betterproto b5 で再現し、その後、server の実行中に client がいつメッセージを受信するかを観察する。その動作を期待されるストリーミングのセマンティクスと比較し、server メソッドが返る前の配信が意図されたものかどうかを判断する。動作が説明され、適切なプロジェクト変更またはテスト範囲が明確になった時点で完了とする。

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

評価

技術スタック
grpc, python
領域
backend-api-design
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

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

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