Skip to content

Conversation

@nlutsenko
Copy link
Contributor

We were not removing the object itself when saving children, which simply task-deadlocked, as the save is already in progress for the root object.
This is following the same code as we have for saveEventually, where we explicitly remove root object from the list of unique objects to save, unless we were given an array.
Collection of dirty children will expand any PFObject into dictionary representation of it's estimatedData, so it's absolutely save to just pass a parse object as the root here.

Concrete example of the issue:

- obj2.save()
- obj2[key1] = obj1
- obj2.save()

---
- obj2[key2] = "randomValue"
- obj2.save() // It used to hang here...

Fixes #587.

@nlutsenko nlutsenko added this to the 1.11.0 milestone Dec 3, 2015
nlutsenko added a commit that referenced this pull request Dec 5, 2015
Fix deadlock on saving an object with a circular reference.
@nlutsenko nlutsenko merged commit 399e348 into master Dec 5, 2015
@nlutsenko nlutsenko deleted the nlutsenko.user.save branch December 5, 2015 00:17
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.

3 participants