mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Deadlocks #334
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @spacedema on GitHub (Jun 22, 2020).
Hi, @JohnEstropia!
dataStack.perform(asynchronous: { transaction in...try db.perform(synchronous: { transaction in...I'm facing deadlocks very frequent. Attaching screenshots with call stacks
And I see that problem is in autoCommit() in AsynchronousDataTransaction. I tried to rewrite it as follows and seems that everything is ok, deadlocks are gone
But I'm not a big specialist in core data at all, so I would like to hear your opinion about this case
Thanks.
@JohnEstropia commented on GitHub (Jul 16, 2020):
I don't really have other suggestions here but to avoid using
perform(synchronous:).The synchronous and asynchronous transactions will collide with each other eventually if you use them together.
@spacedema commented on GitHub (Jul 16, 2020):
Yes, I know it is highly recommended to use asynchronous transactions, but now project has synchronous transactions too.
The main question was about
autoCommitfunction. There are no collides with my changes, so I want to know your opinion about it@JohnEstropia commented on GitHub (Jul 16, 2020):
We can't remove the DispatchGroup here. Without that the synchronous transactions will violate CoreStores transaction serialized processing and stops being a transaction altogether (e.g. A sync transaction can run while another asyn transaction is in progress)
@JohnEstropia commented on GitHub (Jul 16, 2020):
If you really want to bypass transactions like this, feel free to use
DataStack.beginUnsafe(), which creates "transactions" that you can manually manage the threading for.@spacedema commented on GitHub (Jul 16, 2020):
ok, thanks for the answer