-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 a bug that mnesia:add_table_copy/3
could hold a read lock forever
#6013
Conversation
CT Test Results 2 files 55 suites 22m 39s ⏱️ Results for commit 7d47129. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
Thanks, I will take a closer look next week, long weekend here in Sweden. |
I would like a real testcase for this, since you managed to reproduce often enough (1 of 1 when I tried), |
Thank you for your comment. |
I have a question. |
There is already a add_copy_when_going_down test case in mnesia_evil_coverage_test, so |
It would also be great if the branch is re-based to 24.3.4, because this will need to be patched on 24 as well. |
2a3cbbd
to
7d47129
Compare
Thank you for your advice. |
Hi,
I found a rare mnesia bug that could occure when a node ("A") executes
mnesia:add_table_copy/3
to send a table data to another node ("B").If node B terminated during the sending process, node A could hold a read lock forever because that waits for an already received message
{copier_done, node()}
again in a transaction after acquiring a read lock.This PR fixes the redundant
receive
s to prevent the problem.Example code to reproduce the problem
Because this problem is inherently timing dependent, it's difficult to write a deterministic reproducing code. However, the following example code can reproduce the issue with almost 100% probability on my laptop.
Execution result: