8000 Fix deadlock when multiple key lookups are coalessed and one of them throws an KeyNotFoundException by jorisvergeer · Pull Request #433 · reactiveui/Akavache · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix deadlock when multiple key lookups are coalessed and one of them throws an KeyNotFoundException #433

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

Merged
merged 5 commits into from
Dec 27, 2018

Conversation

jorisvergeer
Copy link
Contributor

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Possible fix for #432

What is the current behavior? (You can also link to an open issue here)

See #432

What is the new behavior (if this is a feature change)?

No deadlock

Does this PR introduce a breaking change?

Possibly when the calling application depends on those deadlocks

Please check if the PR fulfills these requirements

Other information:

else
{
elementMap[v].OnNext(Enumerable.Empty<CacheElement>());
catch(KeyNotFoundException e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Given you do a ContainsKey() would this ever be hit?

Copy link
Contributor Author
@jorisvergeer jorisvergeer Dec 18, 2018

Choose a reason for hiding this comment

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

You check resultMap.ContainsKey(v)
Then you do a lookup with elementMap[v] with the same key, so yeah. A KeyNotFoundException could happen.
not true

I don't remember the exact details. I just remember that this fix resolves a lot of crashy behaviour in my app on slow phones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry,

The exception in the issue could have been created further down the reactive observables.
I should have copies the details of the exception back then.

@glennawatson glennawatson changed the title Possible fix for #432 Fix deadlock when multiple key lookups are coalessed and one of them throws an KeyNotFoundException Dec 27, 2018
@glennawatson glennawatson merged commit 5e342eb into reactiveui:master Dec 27, 2018
@glennawatson
Copy link
Contributor

Thanks for the pull request @jorisvergeer know it's been a while but finally in.

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.

3 participants
0