-
Notifications
You must be signed in to change notification settings - Fork 2
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
cache db was leaked #66
Comments
Hi! Sorry for ultra late response. Can you share more details about how to reproduce this issue? |
Hey @martinbonnin not OP but we also see these logs in UI tests. We do call apolloClient.clearHttpCache()
apolloClient.clearNormalizedCache() after each test to clear the state, we also interrupt all currently running flows (btw is there a better way to basically stop everything Apollo is doing?). However after this, it seems that database is still open, so it leaks between the tests. I poked around but couldn't find an API to close the database properly after using |
Hello @martinbonnin I encountered the same issue, is there any fix on this issue? |
It appears this can happen when an In practice, these connections are held by the SQLDelight driver, which is held by the We should propagate I don't believe this error should actually be too worrisome, but in the meantime, it's a bit hacky, but there's a way to close your connections thanks to the // Keep a reference to your db
var sqliteDatabase: SupportSQLiteDatabase? = null
val apolloClient = ApolloClient.Builder()
.normalizedCache(
SqlNormalizedCacheFactory(
this,
configure = {
sqliteDatabase = it
}
)
) and then when you've finished using your client: apolloClient.close()
sqliteDatabase?.close() |
Summary
cache db was leaked.
Version
v2.2.2
Description
SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.my.package/databases/cache.db' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
The text was updated successfully, but these errors were encountered: