-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fatal Exception: RLMException thread constructor failed: Resource temporarily unavailable #8011
Comments
Hi @kafejo can you show some code with how you are using Realm? Can you also submit the full stack trace? |
Sure! func upsert(services: [Service], removeMissing: Bool) -> Promise<Void> {
return Promise { seal in
let realm = RealmManager.shared.realmInstance
let forRemoval: LazyFilterSequence<Results<StoredService>>?
if removeMissing {
let storedServices = realm.objects(StoredService.self)
let missingStored = storedServices.filter { item in !services.contains { $0.id == item.id } }
forRemoval = missingStored
} else {
forRemoval = nil
}
realm.writeAsync {
let storedServices = services.map(StoredService.init)
realm.add(storedServices, update: .modified)
if let forRemoval = forRemoval {
realm.delete(forRemoval)
}
} onComplete: { error in
if let error = error {
seal.reject(error)
} else {
seal.fulfill_()
}
}
}
} where the Realm manager method is just var realmInstance: Realm {
// swiftlint:disable:next force_try
try! Realm()
} Here's a full stack trace:
|
cc @tgoyne do you know what could cause this exception? |
We should probably have some better error handling here to report a more helpful error, but a one time OOM error doesn't seem super concerning. |
Great, thanks for the explanation! That's indeed not that concerning. |
I actually encountered it again at different place. Again only 15 threads but also free RAM.
Seems like the issue is somewhere else? |
@tgoyne or @leemaguire could you please advise or do I need to open a new ticket? I cannot reopen this one. It's still happening in multiple places of my app. |
Same issue |
How frequently does the bug occur?
Seen once
Description
Crash on writeAsync.
Stacktrace & log output
Can you reproduce the bug?
Not yet
Reproduction Steps
The crash happened to a customer in production. I cannot reproduce it but I was wondering what does the crash message actually mean and if it's something I should worry about.
Version
10.32.0
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
iOS 15.1
Build environment
Xcode version: 14.0
Dependency manager and version: Cocoapods 1.11.3
The text was updated successfully, but these errors were encountered: