Hello Jay,
This has been a known problem as least as far back as 2017 - if you search the GitHub issues for Realm-swift for ‘deadlock’ you’ll see it’s never really been addressed.
I do not believe the file locked but rather, writes are not properly managed from the Realm SDK so that they can potentially be locking the file during a suspension that happens while a write operation is occurring.
Of course, this should be managed from within Realm and not an implementation detail for consumers to manage (although if there were documentation from Realm on specifically how to do so safely, that would be a great compromise).
Now there are some workarounds and fixes mentioned on GitHub, but our team is planning to move the realm DB from app group container to app container.
I am simply looking for guidance on how to do so without impacting users or losing data. Are there any FAQs, or discussions related to doing this?