-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix against TimeSpan.Zero for max lifetime #72
Conversation
public TimeSpan OutboundBufferMaxLifetime | ||
{ | ||
get => _outboundBufferMaxLifetime; | ||
set => _outboundBufferMaxLifetime = value >= _outboundBufferMinLifetime ? value : _outboundBufferMaxLifetime; |
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.
Ensuring we can never set max life time to any thing less then 1s.
Otherwise each publish will cause an export, akin to setting OutboundBufferMaxSize
to 1.
…ementation to ensure some drainage happened
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.
A couple of comments.
@@ -70,6 +70,6 @@ public void BulkAll() | |||
channel.TryWriteMany(_data); | |||
channel.TryComplete(); | |||
|
|||
_waitHandle.WaitOne(); | |||
// _waitHandle.WaitOne(); |
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.
Did you mean for this to remain uncommented?
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.
Reverted changes to the benchmark project, wasn't needed in this PR 👍
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
Ensure we never allow
TimeSpan.Zero
since it effectively will behave asOutboundBufferMaxSize = 1
.This also stabilises
WaitToWriteAsync
when usingBoundedChannelFullMode.Wait
to ensure the InboundChannel is sufficiently drained before pumping messages into inbound channel again.Fixes a similar problem as: dotnet/runtime#66281