firebase-admin-java icon indicating copy to clipboard operation
firebase-admin-java copied to clipboard

Realtime Database Async update hangs on error

Open nsadeh opened this issue 3 years ago • 3 comments

[REQUIRED] Step 2: Describe your environment

  • Operating System version: Docker openjdk:8 running on Google Cloud Run
  • Firebase SDK version: 8.0.1
  • Library version: 8.0.1
  • Firebase Product: RT Database (auth, database, storage, etc)

[REQUIRED] Step 3: Describe the problem

I made an update request with a completionListener with a badly sanitized key that had " and :. While I handled errors, this caused the request to end with an Internal error code. I forced the database call to timeout and received an error saying that my input was malformed.

Expectations: if the call to the database is malformed, it should just quit immediately instead of hang.

Steps to reproduce:

  1. Call the updateChildren function with a malformed key
  2. Force the callback to terminate (I used 5 seconds)
  3. You should see an error s.a Firebase Database error: Invalid token in path

nsadeh avatar Sep 15 '21 02:09 nsadeh

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

google-oss-bot avatar Sep 15 '21 02:09 google-oss-bot

Hey @nsadeh I think I am experiencing the same problem. Noob question: how did you force the call to timeout?

stopachka avatar Oct 21 '21 15:10 stopachka

Hey @jsdt can we get a quick comment on this issue just so we know the status when you have a second?

@stopachka it depends on what library you're using for async computation, but I wrapped my call to the DB in a future of some kind and then awaited it with a timeout. This is never good practice for production, but was useful to debug this issue, which is why it's important for this issue to be fixed.

When I am home from work I can post a more complete example of what I did, but since it's in Scala it might be less useful for you if you're using Java.

nsadeh avatar Oct 21 '21 15:10 nsadeh