You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling get() to retrieve a document snapshot concurrently from different threads reliably leads to a deadlock. This was attempted on an M1 Mac and a GCE Cloud Console Linux.
This was tried on google-cloud-firestore=(2.15.0|2.16.0)
Code to reproduce the bug:
importthreadingimportfirebase_adminfromfirebase_adminimportcredentials, firestore__app=firebase_admin.initialize_app(credentials.ApplicationDefault())
defquery_firestore(docid):
db=firestore.client(__app)
coll=db.collection("mycollection")
try:
print("About to query firestore")
doc=coll.document(docid).get().to_dict()
# The flow never reaches here.print(f"Document data: {doc}")
exceptExceptionase:
print(f"Error querying Firestore: {e}")
defstart_threads(n, docid):
threads= []
for_inrange(n):
thread=threading.Thread(target=query_firestore, args=(docid,))
threads.append(thread)
thread.start()
# Wait for all threads to completeforthreadinthreads:
thread.join()
if__name__=="__main__":
N=5# Number of threadsdocid="1234"start_threads(N, docid)
The text was updated successfully, but these errors were encountered:
Calling
get()
to retrieve a document snapshot concurrently from different threads reliably leads to a deadlock. This was attempted on an M1 Mac and a GCE Cloud Console Linux.This was tried on
google-cloud-firestore=(2.15.0|2.16.0)
Code to reproduce the bug:
The text was updated successfully, but these errors were encountered: