Flush task should not flush messages that were written since last flu…#7743
Merged
Conversation
…sh attempt. Motivation: The flush task is currently using flush() which will have the affect of have the flush traverse the whole ChannelPipeline and also flush messages that were written since we gave up flushing. This is not really correct as we should only continue to flush messages that were flushed at the point in time when the flush task was submitted for execution if the user not explicit call flush() by him/herself. Modification: Call *Unsafe.flush0() via the flush task which will only continue flushing messages that were marked as flushed before. Result: More correct behaviour when the flush task is used.
Member
Author
|
I am still thinking about how to add a proper test... Please review in the meantime tho |
Scottmitch
approved these changes
Feb 22, 2018
Member
|
unit test could involve using writing write quota elements (taking into account gathering writes) flushing, then writing 1 more element and not flushing and verify the last element is not actually flushed. You will have to be careful to defeat gathering writes, or limit how much data a gathering write is allowed to write somehow. |
Member
Author
|
@Scottmitch I had no time yet for a test... are you cool with merge it and do a test as a followup ... I am not sure when I have time as the test is a bit tricky :( |
Member
|
@normanmaurer - sure that is fine. I added tests previously to ensure the flush is actually done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…sh attempt.
Motivation:
The flush task is currently using flush() which will have the affect of have the flush traverse the whole ChannelPipeline and also flush messages that were written since we gave up flushing. This is not really correct as we should only continue to flush messages that were flushed at the point in time when the flush task was submitted for execution if the user not explicit call flush() by him/herself.
Modification:
Call *Unsafe.flush0() via the flush task which will only continue flushing messages that were marked as flushed before.
Result:
More correct behaviour when the flush task is used.