-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Work on ConsumerController
deadlock
#7092
Work on ConsumerController
deadlock
#7092
Conversation
ConsumerController.Settings
ConsumerController
deadlock
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.
Self-review
/// When disabled, the <see cref="ConsumerController"/> will discard any <c>Retry</c> messages when it is | ||
/// waiting for a message confirmation. | ||
/// </summary> | ||
public bool RetryConfirmation { get; init; } |
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.
Added new RetryConfirmation
settings
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
if (!Settings.RetryConfirmation) | ||
return; |
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.
Only retry the delivery if RetryConfirmation
is set to true
ReceiveRetry(() => | ||
{ | ||
_log.Debug("Retry sending SequencedMessage [{0}].", sequencedMessage.SeqNr); | ||
CurrentState.Consumer.Tell(new Delivery<T>(sequencedMessage.Message.Message!, Context.Self, | ||
sequencedMessage.ProducerId, sequencedMessage.SeqNr)); | ||
Become(() => WaitingForConfirmation(sequencedMessage)); | ||
}); |
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.
Retry logic
@@ -664,6 +664,8 @@ akka { | |||
# kept in memory in the `ProducerController` until they have been | |||
# confirmed, but the drawback is that lost messages will not be delivered. | |||
only-flow-control = false | |||
|
|||
retry-confirmation = false |
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.
RetryConfirmation
is false by default
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
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 but left some questions
@@ -664,6 +664,8 @@ akka { | |||
# kept in memory in the `ProducerController` until they have been | |||
# confirmed, but the drawback is that lost messages will not be delivered. | |||
only-flow-control = false | |||
|
|||
retry-confirmation = false |
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
@@ -672,4 +673,26 @@ public async Task ConsumerController_can_process_zero_length_Chunk() | |||
consumerController.Tell(seqMessages1.First()); | |||
(await consumerProbe.ExpectMsgAsync<ConsumerController.Delivery<ZeroLengthSerializer.TestMsg>>()).Message.Should().Be(ZeroLengthSerializer.TestMsg.Instance); | |||
} | |||
|
|||
[Fact] | |||
public async Task ConsumerController_must_not_resend_Delivery() |
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
public static readonly Config Config = @" | ||
akka.reliable-delivery.consumer-controller { | ||
flow-control-window = 20 | ||
resend-interval-min = 1s |
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.
Might want to lower this given that you're waiting for up to 1.5 seconds - just to provide a bigger window in the event of racy tests
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.
ok, will do
/// When disabled, the <see cref="ConsumerController"/> will discard any <c>Retry</c> messages when it is | ||
/// waiting for a message confirmation. | ||
/// </summary> | ||
public bool RetryConfirmation { get; init; } |
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
_log.Debug("Retry sending SequencedMessage [{0}].", sequencedMessage.SeqNr); | ||
CurrentState.Consumer.Tell(new Delivery<T>(sequencedMessage.Message.Message!, Context.Self, | ||
sequencedMessage.ProducerId, sequencedMessage.SeqNr)); | ||
Become(() => WaitingForConfirmation(sequencedMessage)); |
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.
Do we need to do a Become
again here? Aren't we already in this state?
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.
There's no harm in doing it, we might as well have the code to explicitly show which state we're transitioning to.
@Arkatufus merged - we'll need a separate PR to add some documentation for this to the Akka.Delivery page on the website |
This reverts commit 1c8ffc3.
This reverts commit 1c8ffc3.
Changes
Fixes #7088 - work in progress.
Checklist
For significant changes, please ensure that the following have been completed (delete if not relevant):
Latest
dev
BenchmarksInclude data from the relevant benchmark prior to this change here.
This PR's Benchmarks
Include data from after this change here.