-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
buffer: fix emit error of race condition #4447
buffer: fix emit error of race condition #4447
Conversation
It looks like a lot of diffs, but most of them are just indentation changes. I have changed |
There are three changes in this PR:
|
I am considering if I can add some tests... |
Even though it will be squashed, split indentation commit may be better. |
I see!! |
After 95438b2 (fluent#4342), there is a section where chunks do not have a lock in `write_step_by_step()`. `write_step_by_step()` must ensure their locks until passing them to the block. Otherwise, race condition can occur and it can cause emit error by IOError. Example of warning messages of emit error: [warn]: #0 emit transaction failed: error_class=IOError error="closed stream" location=... [warn]: #0 send an error event stream to @error: error_class=IOError error="closed stream" location=... Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
I separated commits for clarity. Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
61a2b5a
to
fedb6d4
Compare
Thanks! I have separated them. |
I will check the behavior a little more tomorrow and add some tests if possible, but basically, I think this is prepared. |
I have added a test. |
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.
LGTM
Thanks!
Thanks! |
Which issue(s) this PR fixes:
What this PR does / why we need it:
After 95438b2 (#4342) (v1.16.4), there is a section where chunks do not have a lock in
write_step_by_step()
.write_step_by_step()
must ensure their locks until passing them to the block.Otherwise, race condition can occur and it can cause emit error by IOError.
Example of warning messages of emit error:
Docs Changes:
Not needed.
Release Note:
Buffer: Fix emit error of v1.16.4 sometimes failing to process large data exceeding chunk size limit