Skip to content

[firebase_messaging] StrictMode LeakedClosableViolation in TopicSubscriptionClient / GzipSource #8496

Description

@daniel-pellier-itsap

Describe the bug

When running the app on Android in Debug mode with StrictMode enabled, a LeakedClosableViolation is thrown during FCM topic synchronization (TopicsSyncTask).

Stack trace

D/StrictMode(24299): StrictMode policy violation: android.os.strictmode.LeakedClosableViolation: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
D/StrictMode(24299): at android.os.StrictMode$AndroidCloseGuardReporter.report(StrictMode.java:1786)
D/StrictMode(24299): at dalvik.system.CloseGuard.warnIfOpen(CloseGuard.java:264)
D/StrictMode(24299): at java.util.zip.Inflater.finalize(Inflater.java:398)
D/StrictMode(24299): at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:252)
D/StrictMode(24299): at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:239)
D/StrictMode(24299): at java.lang.Daemons$Daemon.run(Daemons.java:105)
D/StrictMode(24299): at java.lang.Thread.run(Thread.java:764)
D/StrictMode(24299): Caused by: java.lang.Throwable: Explicit termination method 'end' not called
D/StrictMode(24299): at dalvik.system.CloseGuard.open(CloseGuard.java:221)
D/StrictMode(24299): at java.util.zip.Inflater.(Inflater.java:114)
D/StrictMode(24299): at com.android.okhttp.okio.GzipSource.(GzipSource.java:62)
D/StrictMode(24299): at com.android.okhttp.internal.http.HttpEngine.unzip(HttpEngine.java:473)
D/StrictMode(24299): at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:648)
D/StrictMode(24299): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:471)
D/StrictMode(24299): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:407)
D/StrictMode(24299): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:538)
D/StrictMode(24299): at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
D/StrictMode(24299): at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:26)
D/StrictMode(24299): at com.google.firebase.messaging.TopicSubscriptionClient.performTopicOperation(TopicSubscriptionClient.java:110)
D/StrictMode(24299): at com.google.firebase.messaging.TopicSubscriptionClient.subscribe(TopicSubscriptionClient.java:60)
D/StrictMode(24299): at com.google.firebase.messaging.TopicsSubscriber.blockingSubscribeToTopic(TopicsSubscriber.java:272)
D/StrictMode(24299): at com.google.firebase.messaging.TopicsSubscriber.performTopicOperation(TopicsSubscriber.java:232)
D/StrictMode(24299): at com.google.firebase.messaging.TopicsSubscriber.syncTopics(TopicsSubscriber.java:188)
D/StrictMode(24299): at com.google.firebase.messaging.TopicsSyncTask.run(TopicsSyncTask.java:101)
D/StrictMode(24299): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
D/StrictMode(24299): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
D/StrictMode(24299): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
D/StrictMode(24299): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
D/StrictMode(24299): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
D/StrictMode(24299): at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@18.9.0:2)
D/StrictMode(24299): ... 1 more
D/StrictMode(24299): StrictMode policy violation: android.os.strictmode.LeakedClosableViolation: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions