Skip to content

Commit b1ab75d

Browse files
add more logging for cases before close() is called
1 parent e342882 commit b1ab75d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

google/cloud/alloydbconnector/connector.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,17 +383,20 @@ def close(self) -> None:
383383
self.close_async(), loop=self._loop
384384
)
385385
# Will attempt to gracefully shut down tasks for 3s
386+
print("RISHABH DEBUG: before calling close_async()")
386387
close_future.result(timeout=3)
387388
else:
388389
print("RISHABH DEBUG: loop is not running 1")
389390
# if background thread exists for Connector, clean it up
390391
if self._thread.is_alive():
391392
if self._loop.is_running():
392393
# stop event loop running in background thread
394+
print("RISHABH DEBUG: before calling call_soon_threadsafe()")
393395
self._loop.call_soon_threadsafe(self._loop.stop)
394396
else:
395397
print("RISHABH DEBUG: loop is not running 2")
396398
# wait for thread to finish closing (i.e. loop to stop)
399+
print("RISHABH DEBUG: before calling thread.join()")
397400
self._thread.join()
398401
else:
399402
print("RISHABH DEBUG: thread is not alive")

0 commit comments

Comments
 (0)