客户端流导致的channel复用没有初始话
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- grpc, php
- Domain
- api, backend, networking
Research direction
Start with GrpcClient.php recv, runReceiveCoroutine, and closeRecv, then trace how channels are returned to and obtained from the channel pool. Reproduce the client-streaming SendAndClose sequence described in the issue and inspect whether unread close data remains in a reused channel. Done means a subsequent request cannot read stale data from the previous stream.
Written by the indexing model from the issue text.
Description
对于一个客户端流来说 服务端调用了SendAndClose
客户端函数runReceiveCoroutine 对这个流进行revc 实际上进行了3次
第一次是正常的数据返回 但是客户端流只允许调用一次recv 就不会触发到GrpcClientrecv中的 if (($response === false && $channel->errCode === SWOOLE_CHANNEL_TIMEOUT) || ($response instanceof Response && ! $response->pipeline)) {
第二次是关闭
第三次response 为false 走到了如下流程:
closeRecv函数在进行channel 回收的时候没有判断channel里面是否有数据 直接进行了回收
下一个请求获取从channel池里面获取channel 获取到旧的channel 此时channel里面的数据 是第一次请求获取响应中的第二个响应及关闭响应 导致GrpcClient.php中recv进行读取的时候 读到的数据是关闭请求 之后才会触发重置和回收channal
我尝试进行多读一次 和 在closeRecv进行channel->pop() 是可以解决这个问题
不知道是不是我的使用方式有什么问题?
- Dominant language
- PHP
- Stars
- 3
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hyperf/grpc-client
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
hyperf/grpc-client#31 ·
All issues in hyperf/grpc-client
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 84/100
mailcow/mailcow-dockerized#7652 · 2 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
benjaminkott/bootstrap_package#1675 ·