apache / apache/brpc

HTTP2客户端收到goaway之后, 然后收到EOF包(server close), 如果EOF包先执行, 已经返回的正常包会被设置为错误

Open
#2,515 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

**Describe the bug (描述bug)**
比如server可以接收的最大stream_id是200, 那么server会正常处理1-200的所有stream, 并正常返回, 然后才会close连接, 客户端肯定会先收到之前的正常stream返回, 然后才会收到EOF包, 但是由于并行, 可能EOF包先执行, 然后会把该连接上所有的pending请求都置为错误, 但是之前收到的包比如steam_id 187包先于EOF包收到, 但是比EOF后执行, 那么stream_id187包会错误的被当作异常包处理

**To Reproduce (复现方法)**
设置http2 server的最大执行流id上限小一点, 比如200, 客户端压测就可以复现

**Expected behavior (期望行为)**
比server可以执行的最大stream_id小的请求都应该被正确处理, 而不是因为并发先执行EOF, 比最大stream_id小的包就会被当作异常包

**Versions (各种版本)**
OS:
Compiler:
brpc:
protobuf:

**Additional context/screenshots (更多上下文/截图)**

![image](https://github.com/apache/brpc/assets/17529657/55d8edd3-3b0f-4813-bc9c-e7a7dd9c5d75)
客户端已经接受到了stream_id 11的包, 但是被abandone了

Contributor guide

Open the contributing guide

Research direction

Start at the HTTP/2 client handling for GOAWAY and EOF, then reproduce the issue by lowering the server's maximum stream ID to 200 and applying client load. Done means requests with stream IDs below the server limit remain successful even when EOF handling executes before their already-received responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.