Title: 2 consecutive calls to CloudLoggingHandler.close throws an exception · Issue #989 · googleapis/python-logging · GitHub
Open Graph Title: 2 consecutive calls to CloudLoggingHandler.close throws an exception · Issue #989 · googleapis/python-logging
X Title: 2 consecutive calls to CloudLoggingHandler.close throws an exception · Issue #989 · googleapis/python-logging
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...
Open Graph 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 ...
X 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 ...
Opengraph URL: https://github.com/googleapis/python-logging/issues/989
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"2 consecutive calls to CloudLoggingHandler.close throws an exception","articleBody":"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.\n\nIf you are still having issues, please be sure to include as much information as possible:\n\n#### Environment details\n\n - Python version: 3.12.10\n - `google-cloud-logging` version: 3.12.0\n\n#### Steps to reproduce\n\n 1. Call client.flush_handlers and then client.close explicitly\n 2. When GAE terminates the gunicorn worker, it reports the error\n\n#### Stack trace\n```\n Traceback (most recent call last):\n File \"/layers/google.python.runtime/python/lib/python3.12/logging/__init__.py\", line 2265, in shutdown\n h.close()\n File \"/layers/google.python.pip/pip/lib/python3.12/site-packages/google/cloud/logging_v2/handlers/handlers.py\", line 248, in close\n h.close()\n File \"/layers/google.python.pip/pip/lib/python3.12/site-packages/google/cloud/logging_v2/handlers/handlers.py\", line 248, in close\n self.transport.close()\n```\n","author":{"url":"https://github.com/otorreno","@type":"Person","name":"otorreno"},"datePublished":"2025-04-21T11:09:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/989/python-logging/issues/989"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f79f4529-e42a-fada-5ee7-e7cbaf49b9e8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E144:27C8DB:B73934:FFEC53:6A4CA21D |
| html-safe-nonce | 9b06a619b482af86e0444841c1c79a23230176c7c808d63cc27a03d6f8c703bb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTQ0OjI3QzhEQjpCNzM5MzQ6RkZFQzUzOjZBNENBMjFEIiwidmlzaXRvcl9pZCI6Ijc0OTIyNjQ3NjM5NDgwNDg5MjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ac2d3d393b33dc700fc1baab715657a3cdded11dcb5efd7e3b5eaf57e7d8c090 |
| hovercard-subject-tag | issue:3008183049 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-logging/989/issue_layout |
| twitter:image | https://opengraph.githubassets.com/067b90296749fbeb6992ef702d6389c0b1806043ac56189b8231bcb67ea2a561/googleapis/python-logging/issues/989 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/067b90296749fbeb6992ef702d6389c0b1806043ac56189b8231bcb67ea2a561/googleapis/python-logging/issues/989 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | otorreno |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-logging git https://github.com/googleapis/python-logging.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992562 |
| octolytics-dimension-repository_nwo | googleapis/python-logging |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992562 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-logging |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ae90d426644ca15e89bacceb72e51f4e9dbf85f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width