firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.27k stars 575 forks source link

in Crachtlystcs Fatal Exception: java.util.concurrent.RejectedExecutionException #3803

Closed yousefbeiruty closed 2 years ago

yousefbeiruty commented 2 years ago

Fatal Exception: java.util.concurrent.RejectedExecutionException Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@c1500d8 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@49f43bb[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 18] java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution (ThreadPoolExecutor.java:2014)

java.util.concurrent.ScheduledThreadPoolExecutor.execute (ScheduledThreadPoolExecutor.java:616) io.grpc.internal.SerializingExecutor.schedule (SerializingExecutor.java:93) io.grpc.internal.SerializingExecutor.execute (SerializingExecutor.java:86) io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.closedInternal (ClientCallImpl.java:750) io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.closed (ClientCallImpl.java:686) io.grpc.internal.DelayedStream$DelayedStreamListener$5.run (DelayedStream.java:485) io.grpc.internal.DelayedStream$DelayedStreamListener.delayOrExecute (DelayedStream.java:426) io.grpc.internal.DelayedStream$DelayedStreamListener.closed (DelayedStream.java:482) io.grpc.internal.ForwardingClientStreamListener.closed (ForwardingClientStreamListener.java:39) io.grpc.internal.InternalSubchannel$CallTracingTransport$1$1.closed (InternalSubchannel.java:697) io.grpc.internal.AbstractClientStream$TransportState.closeListener (AbstractClientStream.java:459) io.grpc.internal.AbstractClientStream$TransportState.access$400 (AbstractClientStream.java:221) io.grpc.internal.AbstractClientStream$TransportState$1.run (AbstractClientStream.java:442) io.grpc.internal.AbstractClientStream$TransportState.deframerClosed (AbstractClientStream.java:278) io.grpc.internal.Http2ClientStreamTransportState.deframerClosed (Http2ClientStreamTransportState.java:31) io.grpc.okhttp.OkHttpClientStream$TransportState.deframerClosed (OkHttpClientStream.java:304) io.grpc.internal.MessageDeframer.close (MessageDeframer.java:233) io.grpc.internal.MessageDeframer.closeWhenComplete (MessageDeframer.java:191) io.grpc.internal.AbstractStream$TransportState.closeDeframer (AbstractStream.java:203) io.grpc.internal.AbstractClientStream$TransportState.transportReportStatus (AbstractClientStream.java:445) io.grpc.okhttp.OkHttpClientTransport.startGoAway (OkHttpClientTransport.java:887) io.grpc.okhttp.OkHttpClientTransport.access$1600 (OkHttpClientTransport.java:109) io.grpc.okhttp.OkHttpClientTransport$ClientFrameHandler.run (OkHttpClientTransport.java:1113) java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1113)

google-oss-bot commented 2 years ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

abbas427 commented 2 years ago

I'm also facing the same issue.

argzdev commented 2 years ago

Hi @yousefbeiruty, thanks for reporting. May I know what Firebase products are you using? Also your logs doesn't show anything related to Firebase, could you provide more details why you think Firebase is the culprit here? Thanks!

yousefbeiruty commented 2 years ago

vide more details why you think Firebase is the culprit here? Thanks!

Hi @argzdev i am using for firebase the crash list analystic and the storage firebase and messaging and i am using Google cloud Pub/Sub

 /**PubSub Google Cloud */
    //implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'

    implementation('com.google.cloud:google-cloud-pubsub:1.105.0') {
        exclude group: 'org.apache.httpcomponents'
        // exclude group:'com.google.protobuf'
    }
    implementation('com.google.firebase:firebase-inappmessaging-display:19.1.5', {
        exclude group: 'io.grpc', module: 'grpc-okhttp'
    })
    implementation "io.grpc:grpc-okhttp:$okhttp"
    implementation "org.jetbrains.anko:anko:$anko"
argzdev commented 2 years ago

Thanks for these details, @yousefbeiruty, however I don't see Crashlytics, Analytics, Storage in your code snippet. Could you update it, and provide these products with their versions? Any chance you could provide steps how to reproduce this issue? Or if you have a minimal repro of the issue? It'll help us investigating this a lot.

Also have you tried submitting an issue in the grpc repository?

yousefbeiruty commented 2 years ago

Thanks for these details, @yousefbeiruty, however I don't see Crashlytics, Analytics, Storage in your code snippet. Could you update it, and provide these products with their versions? Any chance you could provide steps how to reproduce this issue? Or if you have a minimal repro of the issue? It'll help us investigating this a lot.

Also have you tried submitting an issue in the grpc repository?

Ok for reproduce this issue i don't know really because this is a production app on Google play store and this crush message appears on Firebase analytics and i cant see it on my device but here are the dependencies with the versions that i am using:-

 //analytics
      analytics = '19.0.0'
   //perf
     perf = '20.0.1'
    //messaging
    messaging = '22.0.0'
   //crashlytics
    crashlytics = '18.1.0'
    //storage
    firebasestore = '20.0.0'

    implementation "com.google.firebase:firebase-analytics:$analytics"
    implementation "com.google.firebase:firebase-perf:$perf"
    implementation "com.google.firebase:firebase-messaging:$messaging"
    implementation "com.google.firebase:firebase-crashlytics:$crashlytics"
    implementation "com.google.firebase:firebase-storage:$firebasestore"

  /**PubSub Google Cloud */
    //implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'

    implementation('com.google.cloud:google-cloud-pubsub:1.105.0') {
        exclude group: 'org.apache.httpcomponents'
        // exclude group:'com.google.protobuf'
    }
    implementation('com.google.firebase:firebase-inappmessaging-display:19.1.5', {
        exclude group: 'io.grpc', module: 'grpc-okhttp'
    })
    implementation "io.grpc:grpc-okhttp:$okhttp"
    implementation "org.jetbrains.anko:anko:$anko"
argzdev commented 2 years ago

After investigating, it looks like only com.google.firebase:firebase-inappmessaging-display uses grpc: 1.44.0, and currently, the grpc repository's latest version is 1.47.0.

However, given that there are the logs doesn't say much about where the issue lies, and there are no code snippets or steps to reproduce this issue, it's difficult to say how the issue has occurred. Let's leave the issue open for now, in case some of our engineers might have an idea what caused this. Feel free to add more details. Thanks!

argzdev commented 2 years ago

Actually now that I think about it, I'm guessing the issue is coming from how you've implemented io.grpc:grpc-okhttp:$okhttp. I did see that you've opened a ticket in the grpc repository. That being said, since the issue is on grpc library, I'll be closing this issue now. Thanks!