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

Ensure inbound buffer is always flushed to outbound #44

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

stevejgordon
Copy link
Contributor

@stevejgordon stevejgordon commented Feb 2, 2024

If we haven't hit the threshold and InChannel.Reader is completed, we can lose the last batch of data.

@stevejgordon stevejgordon added the bug Something isn't working label Feb 2, 2024
@stevejgordon stevejgordon requested a review from Mpdreamz February 2, 2024 13:44
Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

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

Small nit but otherwise LGTM, rather flush slightly too often vs one time too few.

if (InboundBuffer.Count > 0)
await FlushBufferAsync().ConfigureAwait(false);

#if DEBUG
Copy link
Member

Choose a reason for hiding this comment

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

Should this be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can probably remove it. It's been there for a while but serves no real value now.

src/Elastic.Channels/BufferedChannelBase.cs Outdated Show resolved Hide resolved
src/Elastic.Channels/BufferedChannelBase.cs Show resolved Hide resolved
src/Elastic.Channels/BufferedChannelBase.cs Outdated Show resolved Hide resolved
@stevejgordon stevejgordon merged commit f93c967 into main Feb 5, 2024
4 checks passed
@stevejgordon stevejgordon deleted the bug-drain-outbound-buffer branch February 5, 2024 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants