-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Deadlock in latest 3.4.0 #212
Comments
If you are using any locking mechanism to synchronize nitrite write, remove it. If not, please share a reproducible code. |
It seems removing a lock from an outer method, fixed the issue, the locks where there from an implementation before using nitrite. Also, how this relates to issue #204 |
In version 3.4.0 locking mechanism of nitrite has changed from 3.3.0. In 3.3.0 app developer needs to synchronize read-write and indexing separately, now from 3.4.0 it is managed by nitrite only. For upsert, update/insert and index write all are managed using a single |
I was able to reproduce it. Try using 2 keys in an upsert update. eg.
If you need i can share the code, but its very easy reproducible. I couldn't pass the invokeAll method in debug mode.
|
Did you run the above code with 3.4.0 or 3.3.0? I ran below test code on 3.4.0 and it went fine without any issues @Test
public void testIssue212() {
NitriteCollection collection = db.getCollection("test");
Document doc1 = createDocument("key", "key").put("second_key", "second_key").put("third_key", "third_key");
Document doc2 = createDocument("key", "key").put("second_key", "second_key").put("fourth_key", "fourth_key");
Document doc = createDocument("fifth_key", "fifth_key");
collection.insert(doc1, doc2);
collection.update(Filters.and(Filters.eq("key", "key"),
Filters.eq("second_key", "second_key")), doc, UpdateOptions.updateOptions(true));
for (Document document : collection.find()) {
System.out.println(document);
}
} |
Try adding indexes for both fields. Sorry, i didn't mention it previously.
|
Nice find.. I am going to give an emergency fix in version 3.4.1 |
In the recent release (3.4.0), my app is hanging in an upsert update (ObjectRepository)
Maybe is related to the changes made in #193.
The text was updated successfully, but these errors were encountered: