-
Notifications
You must be signed in to change notification settings - Fork 949
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
bugfix: copy data before put it into ringbuf #1471
bugfix: copy data before put it into ringbuf #1471
Conversation
Big brother is watching on you. 😄 @fuweid |
if the consumer pops the data slower than the producer, the data will be overrided by the coming data. Signed-off-by: Wei Fu <[email protected]>
@allencloud That is why I like the CI 😄 |
I think the CI failure is a flaky test which is described in #1470 :
I re-trigger the test and I will fix the test asap. |
Codecov Report
@@ Coverage Diff @@
## master #1471 +/- ##
==========================================
- Coverage 40.31% 38.67% -1.65%
==========================================
Files 251 251
Lines 16416 17212 +796
==========================================
+ Hits 6618 6656 +38
- Misses 8956 9705 +749
- Partials 842 851 +9
|
// in the ringbuf. | ||
// | ||
// However, copy data maybe impact the performance. We need to reconsider | ||
// other better way to handle the IO. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, AWY, we need a better way to handle IO later !
LGTM |
if the consumer pops the data slower than the producer, the data will be
overrided by the coming data.
Signed-off-by: Wei Fu [email protected]
Ⅰ. Describe what this PR did
Fixed bug caused by the shared data.
In the pouch, we use the following statement to copy data from fifo into containerio.
However, the data is shared by the multiple write. Please check the io.Copy.
If we don't copy the data before write it into ringbuf, it maybe override by the coming new data/
Ⅱ. Does this pull request fix one issue?
NONE.
Ⅲ. Describe how you did it
Please check the code.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews