Title: spanner: occasional "google.api_core.exceptions.Aborted: 409 Transaction not found" error with PingingPool · Issue #10 · googleapis/python-spanner · GitHub
Open Graph Title: spanner: occasional "google.api_core.exceptions.Aborted: 409 Transaction not found" error with PingingPool · Issue #10 · googleapis/python-spanner
X Title: spanner: occasional "google.api_core.exceptions.Aborted: 409 Transaction not found" error with PingingPool · Issue #10 · googleapis/python-spanner
Description: Given spanner_v1 VERSION1.11.0, I am obtaining a transaction from a PingingPool as per # Create a session pool that'll periodically refresh every 3 minutes (arbitrary choice value). pool = spanner.PingingPool(size=10, default_timeout=5, ...
Open Graph Description: Given spanner_v1 VERSION1.11.0, I am obtaining a transaction from a PingingPool as per # Create a session pool that'll periodically refresh every 3 minutes (arbitrary choice value). pool = spanner....
X Description: Given spanner_v1 VERSION1.11.0, I am obtaining a transaction from a PingingPool as per # Create a session pool that'll periodically refresh every 3 minutes (arbitrary choice value). pool = span...
Opengraph URL: https://github.com/googleapis/python-spanner/issues/10
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"spanner: occasional \"google.api_core.exceptions.Aborted: 409 Transaction not found\" error with PingingPool","articleBody":"Given spanner_v1 **VERSION1.11.0**, I am obtaining a transaction from a PingingPool as per\r\n```python\r\n # Create a session pool that'll periodically refresh every 3 minutes (arbitrary choice value).\r\n pool = spanner.PingingPool(size=10, default_timeout=5, ping_interval=180)\r\n background_thread = threading.Thread(target=pool.ping, name='ping-pool')\r\n background_thread.daemon = True\r\n background_thread.start()\r\n\r\n db = client_instance.database(database, pool=pool)\r\n if not db.exists():\r\n raise ProgrammingError(\"database '%s' does not exist.\" % database)\r\n\r\n sess = db.session()\r\n ...\r\n # Then later obtaining a transaction and holding it for a long-ish time\r\n txn = sess.transaction()\r\n txn.begin()\r\n # Do a bunch of operations with the operation\r\n ...\r\n txn.commit()\r\n```\r\nand I can confirm that pool isn't being used concurrently, but I've seen a test failure with\r\n```shell\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/grpc/_channel.py\", line 726, in _end_unary_response_blocking\r\n raise _InactiveRpcError(state)\r\ngrpc._channel._InactiveRpcError: \u003c_InactiveRpcError of RPC that terminated with:\r\n\tstatus = StatusCode.ABORTED\r\n\tdetails = \"Transaction not found\"\r\n\tdebug_error_string = \"{\"created\":\"@1580854844.873538358\",\"description\":\"Error received from peer ipv4:172.217.204.95:443\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":1056,\"grpc_message\":\"Transaction not found\",\"grpc_status\":10}\"\r\n```\r\nand in full detail\r\n\r\n\u003cdetails\u003e\r\n\r\n```shell\r\nTraceback (most recent call last):\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/google/api_core/grpc_helpers.py\", line 57, in error_remapped_callable\r\n return callable_(*args, **kwargs)\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/grpc/_channel.py\", line 824, in __call__\r\n return _end_unary_response_blocking(state, call, False, None)\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/grpc/_channel.py\", line 726, in _end_unary_response_blocking\r\n raise _InactiveRpcError(state)\r\ngrpc._channel._InactiveRpcError: \u003c_InactiveRpcError of RPC that terminated with:\r\n\tstatus = StatusCode.ABORTED\r\n\tdetails = \"Transaction not found\"\r\n\tdebug_error_string = \"{\"created\":\"@1580854844.873538358\",\"description\":\"Error received from peer ipv4:172.217.204.95:443\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":1056,\"grpc_message\":\"Transaction not found\",\"grpc_status\":10}\"\r\n\u003e\r\nThe above exception was the direct cause of the following exception:\r\nTraceback (most recent call last):\r\n File \"runtests.py\", line 507, in \u003cmodule\u003e\r\n options.exclude_tags,\r\n File \"runtests.py\", line 294, in django_tests\r\n extra_tests=extra_tests,\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/test/runner.py\", line 629, in run_tests\r\n old_config = self.setup_databases(aliases=databases)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/test/runner.py\", line 554, in setup_databases\r\n self.parallel, **kwargs\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/test/utils.py\", line 174, in setup_databases\r\n serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True),\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/spanner/django/creation.py\", line 33, in create_test_db\r\n super().create_test_db(*args, **kwargs)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/db/backends/base/creation.py\", line 72, in create_test_db\r\n run_syncdb=True,\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/core/management/__init__.py\", line 148, in call_command\r\n return command.execute(*args, **defaults)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/core/management/base.py\", line 364, in execute\r\n output = self.handle(*args, **options)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/core/management/base.py\", line 83, in wrapped\r\n res = handle_func(*args, **kwargs)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/core/management/commands/migrate.py\", line 257, in handle\r\n self.verbosity, self.interactive, connection.alias, apps=post_migrate_apps, plan=plan,\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/core/management/sql.py\", line 51, in emit_post_migrate_signal\r\n **kwargs\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/dispatch/dispatcher.py\", line 175, in send\r\n for receiver in self._live_receivers(sender)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/dispatch/dispatcher.py\", line 175, in \u003clistcomp\u003e\r\n for receiver in self._live_receivers(sender)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/contrib/auth/management/__init__.py\", line 83, in create_permissions\r\n Permission.objects.using(using).bulk_create(perms)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/db/models/query.py\", line 468, in bulk_create\r\n self._batched_insert(objs_with_pk, fields, batch_size, ignore_conflicts=ignore_conflicts)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/db/models/query.py\", line 1211, in _batched_insert\r\n self._insert(item, fields=fields, using=self.db, ignore_conflicts=ignore_conflicts)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/db/models/query.py\", line 1186, in _insert\r\n return query.get_compiler(using=using).execute_sql(return_id)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/db/models/sql/compiler.py\", line 1368, in execute_sql\r\n cursor.execute(sql, params)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/db/backends/utils.py\", line 67, in execute\r\n return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/db/backends/utils.py\", line 76, in _execute_with_wrappers\r\n return executor(sql, params, many, context)\r\n File \"/home/travis/build/orijtech/spanner-orm/django_tests/django/django/db/backends/utils.py\", line 84, in _execute\r\n return self.cursor.execute(sql, params)\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/spanner/dbapi/cursor.py\", line 87, in execute\r\n self.__handle_insert(self.__get_txn(), sql, args or None)\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/spanner/dbapi/cursor.py\", line 128, in __handle_insert\r\n res = txn.execute_update(sql, params=params, param_types=param_types)\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/google/cloud/spanner_v1/transaction.py\", line 202, in execute_update\r\n metadata=metadata,\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/google/cloud/spanner_v1/gapic/spanner_client.py\", line 810, in execute_sql\r\n request, retry=retry, timeout=timeout, metadata=metadata\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py\", line 143, in __call__\r\n return wrapped_func(*args, **kwargs)\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/google/api_core/retry.py\", line 286, in retry_wrapped_func\r\n on_error=on_error,\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/google/api_core/retry.py\", line 184, in retry_target\r\n return target()\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/google/api_core/timeout.py\", line 214, in func_with_timeout\r\n return func(*args, **kwargs)\r\n File \"/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/google/api_core/grpc_helpers.py\", line 59, in error_remapped_callable\r\n six.raise_from(exceptions.from_grpc_error(exc), exc)\r\n File \"\u003cstring\u003e\", line 3, in raise_from\r\ngoogle.api_core.exceptions.Aborted: 409 Transaction not found\r\n```\r\n\u003c/details\u003e","author":{"url":"https://github.com/odeke-em","@type":"Person","name":"odeke-em"},"datePublished":"2020-02-04T22:32:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/10/python-spanner/issues/10"}
| 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:e267816d-ca4e-e82c-74a7-6bbdaf38430a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8BEC:2CD26:4C1BB9:6FD9E0:6A4E0AB7 |
| html-safe-nonce | 3553b88eb82e87b1aeae67a59e7a1221af5d8fca901339ae67f9975ea27ca771 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkVDOjJDRDI2OjRDMUJCOTo2RkQ5RTA6NkE0RTBBQjciLCJ2aXNpdG9yX2lkIjoiNzA5Nzc1ODk1NjgxNDk5NDEwMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 13a64876142c97b228b01ed1fd07e2d8b6fa1b76687d6c3ee6fc539e15d76ecc |
| hovercard-subject-tag | issue:560020130 |
| 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-spanner/10/issue_layout |
| twitter:image | https://opengraph.githubassets.com/434ff3e4ab953222b64a20766231206ac4504c21b82320a6a534966329727987/googleapis/python-spanner/issues/10 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/434ff3e4ab953222b64a20766231206ac4504c21b82320a6a534966329727987/googleapis/python-spanner/issues/10 |
| og:image:alt | Given spanner_v1 VERSION1.11.0, I am obtaining a transaction from a PingingPool as per # Create a session pool that'll periodically refresh every 3 minutes (arbitrary choice value). pool = spanner.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | odeke-em |
| hostname | github.com |
| expected-hostname | github.com |
| None | df0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-spanner git https://github.com/googleapis/python-spanner.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992630 |
| octolytics-dimension-repository_nwo | googleapis/python-spanner |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992630 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-spanner |
| 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 | 51470c353b8a1f52a88d3e3cc2014b17ab8cc1ce |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width