Skip to content

Make batch create stream SendFeedback thread safe#3215

Open
jenrryyou wants to merge 1 commit intoapache:masterfrom
jenrryyou:batch_stream_send_feedback
Open

Make batch create stream SendFeedback thread safe#3215
jenrryyou wants to merge 1 commit intoapache:masterfrom
jenrryyou:batch_stream_send_feedback

Conversation

@jenrryyou
Copy link
Contributor

What problem does this PR solve?

Issue Number: resolve
Fixes #2754

Problem Summary:
批量创建stream场景下,解决 Stream SetConnected() 与 Consume() 并发导致的 SendFeedback
发送与已消费字节统计的竞态问题,使得反馈的已消费字节数准确,避免发送端错误反压。

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects:
  1. 对非批量创建场景,会走到fast path,对性能无任何影响;
  2. 对批量创建场景,连接建立前的消费路径会略增 CPU,但只发生在“建连窗口期”,创建完后对性能无任何影响。
  • Breaking backward compatibility:
    兼容

Check List:

@wwbmmm
Copy link
Contributor

wwbmmm commented Feb 6, 2026

Can you add some unit test to verify this scenario?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants