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

Stream consumers on lost clients #1669

Merged

Conversation

jason-bragg
Copy link
Contributor

Added basic tests demonstrating issues with losing clients that are consuming from streams.
Fixed sms and azure queue and event hub stream providers to handle delivery failures to loss clients.
Azure queue test is disabled as it does not work well yet due to issues unrelated to this PR or client stream consumers.

@jason-bragg jason-bragg changed the title Steam consumers on lost clients Stream consumers on lost clients Apr 9, 2016
@@ -501,7 +501,7 @@ internal void TryForwardRequest(Message message, ActivationAddress oldAddress, A
}
catch (Exception ex)
{
if (!(ex.GetBaseException() is KeyNotFoundException))
if (!(ex.GetBaseException() is KeyNotFoundException) && !(ex.GetBaseException() is ClientNotAvailableException))
Copy link
Contributor

Choose a reason for hiding this comment

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

lets use bool doNotLog instead, for readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ShouldLogError? to avoid double negative?

@gabikliot
Copy link
Contributor

Jason, I thought more about it during the week, and it does not make sense to me that Concurrent Dictionary will throw modification exception if mutated while iteration. It is supposed to allow concurrent modification from another thread, how come it will disallow when it comes from the same thread?
I would test this, and you might find out there is no problem at all, thus no need either to copy or do anything else.

@jason-bragg
Copy link
Contributor Author

It does not make sense to me that Concurrent Dictionary will throw modification exception if mutated while iteration.

Tested repeatedly. Seems ok without the ToList(). Also, reading up on concurrent dictionary seems to confirm your expectations.

@jason-bragg jason-bragg force-pushed the StreamConsumerOnLostClientTests branch from ac1626a to b2c2e33 Compare April 11, 2016 21:18
@gabikliot
Copy link
Contributor

Re concurrent dictionary: great, that simplifies a lot!

@jason-bragg jason-bragg force-pushed the StreamConsumerOnLostClientTests branch from b2c2e33 to b923d49 Compare April 12, 2016 22:39
@sergeybykov
Copy link
Contributor

@dotnet-bot test this please

@sergeybykov sergeybykov merged commit 5c736dd into dotnet:master Apr 13, 2016
@sergeybykov sergeybykov mentioned this pull request Apr 13, 2016
12 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants