DEADLINE_EXCEEDED throw by callable function

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository.
If you have a general question, need help debugging, or fall into some
other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 3.5
  • Firebase Component: Functions (Database, Firestore, Storage, Functions, etc)
  • Component version: 19.0.0

[REQUIRED] Step 3: Describe the problem

I’m getting DEADLINE_EXCEEDED exception when trying to call a function and sending a base64 payload with it.

Steps to reproduce:

Just call a function with a large enough payload and the exception will trigger.
Important to notice that the second time that I call it the function works properly. Probably the cold-start time of the function contributes to this problem.

What happened? How can we make the problem occur?
I think that the problem is on the writeTimeout of the OkHttp client. I’m not an expert of that library but it may be possible that the setTimeout function is just about the complete call and not the upload part. Here’s the reference
https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.Builder.html#writeTimeout-java.time.Duration-

Relevant Code:

1 possible answer(s) on “DEADLINE_EXCEEDED throw by callable function

  1. I have the same problem as well. It happens the first time the onCall function is invoked. Sometimes It throws this exception even when the function completes successfully.