Closed
Description
There was a recent release (3.12.0) that included the changes introduced in #917. The newly introduced close method seems to be called by AppEngine Python runtime at shutdown, so if you would call it explicitly before the runtime does it, then the close function throws an exception because transport is None.
If you are still having issues, please be sure to include as much information as possible:
Environment details
- Python version: 3.12.10
google-cloud-logging
version: 3.12.0
Steps to reproduce
- Call client.flush_handlers and then client.close explicitly
- When GAE terminates the gunicorn worker, it reports the error
Stack trace
Traceback (most recent call last):
File "/layers/google.python.runtime/python/lib/python3.12/logging/__init__.py", line 2265, in shutdown
h.close()
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/google/cloud/logging_v2/handlers/handlers.py", line 248, in close
h.close()
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/google/cloud/logging_v2/handlers/handlers.py", line 248, in close
self.transport.close()