Skip to content

Commit c7feaa1

Browse files
committed
fix: fix thread cleanup when destroying Watch instance
1 parent 995fad6 commit c7feaa1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

google/cloud/firestore_v1/watch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ def on_snapshot(self, proto):
440440
proto(`google.cloud.firestore_v1.types.ListenResponse`):
441441
Callback method that receives a object to
442442
"""
443+
if self._closing.locked():
444+
# don't process on_snapshot responses while spinning down, to prevent deadlock
445+
return
443446
if proto is None:
444447
self.close()
445448
return

0 commit comments

Comments
 (0)