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

Change in PR #2044 has a risk of death lock #2050

Closed
wants to merge 1 commit into from

Conversation

liuyueve
Copy link

@liuyueve liuyueve commented Sep 8, 2020

I guess code change in pr #2044 may produce death lock.So I add a test case to avoid it.

@liuyueve
Copy link
Author

liuyueve commented Sep 8, 2020

hello @harawata,
I think BlockingCache in current version also has this problem.

@harawata
Copy link
Member

harawata commented Sep 8, 2020

Thank you for the test, @liuyueve .

As you noticed, the test fails with the current master as well.

The sole purpose of BlockingCache is to avoid thundering herd problem.
Considering MyBatis' cache processing mechanism, it may not be possible to avoid deadlock when it is used incorrectly.
Please use it wisely. :)

As there were similar reports before, I have added a javadoc comment about the risk.

p.s.
You can update existing PR by pushing new changes to the same branch instead of creating a new PR on every trivial change.

@harawata
Copy link
Member

#2044 is merged.
Please let me know if you have any further question.

@harawata harawata closed this Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants