Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复缓冲区消息多出一份的情况 #445

Merged
merged 1 commit into from
Mar 23, 2023
Merged

Conversation

GXKe
Copy link
Contributor

@GXKe GXKe commented Mar 16, 2023


name: Pull request
about: Propose changes to the code
title: '修复消息多出一份的情况'
labels: ''
assignees: ''

version:v2.2.5

问题场景:

  1. conn首次OnTraffic响应,未消费buf数据
  2. 框架会复制保存buf到inboundBuffer _, _ = c.inboundBuffer.Write(c.buffer)
  3. 异步协程wake唤醒conn
  4. 此时conn.Peek出来的buf数据是两份 (c.inboundBuffer + c.buffer)

tcp read这里修复后已经用起来了
readUDP方法应该也需要修复测试一下

Copy link
Owner

@panjf2000 panjf2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

谢谢找到这个问题并发起 PR,我想针对这个 case 加一个测试在 gnet_test.go,请你有时间的时候在这个 PR 里加一下,谢谢!

@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (edffef8) 76.46% compared to head (6966aa9) 76.46%.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #445   +/-   ##
=======================================
  Coverage   76.46%   76.46%           
=======================================
  Files          15       15           
  Lines        1500     1500           
=======================================
  Hits         1147     1147           
  Misses        271      271           
  Partials       82       82           
Flag Coverage Δ
unittests 76.46% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
eventloop.go 71.90% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@panjf2000 panjf2000 merged commit 5b811bd into panjf2000:dev Mar 23, 2023
@GXKe GXKe deleted the soebr.pr branch March 23, 2023 02:41
@GXKe GXKe restored the soebr.pr branch August 22, 2023 06:08
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.

None yet

2 participants